在PostgreSQL中使用symfony [英] Using symfony with postgresql

查看:82
本文介绍了在PostgreSQL中使用symfony的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Symfony和PostgreSQL创建一个网站。我找不到任何说明如何执行此操作的文档。所有文档都假定后端数据库是mySQL。

I am trying to create a website using Symfony and PostgreSQL. I cant find any documentation that shows how to do this. All the documentation assumes the backend db is mySQL.

任何人都知道该怎么做吗?

Anyone knows how to do this?

推荐答案

完整的答案(花了我大约一个小时来弄清楚)是:

The full answer (took me about an hour to figure this out) is:


  1. 将database.yml修改为在此处(请参见Propel或教义)

  2. (假设您像我一样在使用Propel ORM),如下所示修改propel.ini(未记录的AFAIK)

  1. Modify database.yml as described here (see under Propel or Doctrine)
  2. (assuming you're using the Propel ORM like I am) Modify propel.ini as shown below (undocumented AFAIK)

在propel.ini名称中查找一部分; mysql选项

Look for a section in your propel.ini names ;mysql options

注释掉mysql选项-否则生成的SQL是postgresql和mysql的混合-混淆了psql。

comment the mysql options out - otherwise the generated SQL is a mix of postgresql and mysql - which confuses the hell out of psql.

这篇关于在PostgreSQL中使用symfony的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆