Sam*_*Sam 10 php migration postgresql orm propel
我正在尝试在我的开发Propel项目中第一次使用迁移(所以我不必重新插入15MB的数据),但是遇到了一些困难.我在架构中进行了更改并运行propel-gen diff
.我第一次收到错误,无法找到我的buildtime-conf.xml
文件.我还没有制作一个(因为没有必要),但是读到结构应该和它一样runtime-conf.xml
.我复制runtime-conf.xml
到了buildtime-conf.xml
.现在收到以下错误:
[propel-sql-diff] Reading databases structure...
[phingcall] Unable to find adapter for datasource [project].
Execution of target "sql-diff" failed for the following reason: /var/www/project/vendor/propel/propel1/generator/build-propel.xml:317:26: Execution of the target buildfile failed. Aborting.
[phing] /var/www/project/vendor/propel/propel1/generator/build-propel.xml:317:26: Execution of the target buildfile failed. Aborting.
Run Code Online (Sandbox Code Playgroud)
我的运行时和构建时文件如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<config>
<propel>
<datasources default="project">
<datasource id="project">
<adapter>pgsql</adapter>
<connection>
<dsn>pgsql:host=###.###.###.###;dbname=database</dsn>
<user>USER</user>
<password>PASS</password>
</connection>
</datasource>
</datasources>
</propel>
</config>
Run Code Online (Sandbox Code Playgroud)
我的架构与此类似:
<?xml version="1.0" encoding="UTF-8"?>
<database name="project" defaultIdMethod="native">
<table schema="accounts" name="accounts" phpName="Account" package="accounts">
<column />
</table>
</database>
Run Code Online (Sandbox Code Playgroud)
我尝试将buildtime-conf <datasource id="testing">
更改为,并将错误更改为Unable to find adapter for datasource [testing]
.因此,就我所知,错误在于实际的buildtime-conf文件(而不是架构).我想也许Propel找不到PostgreSQL的适配器(即使它在我的运行时配置中工作正常),所以我尝试将我的适配器更改为mysql
.它提出了同样无法找到适配器错误.
我完全迷失了,想法?
更新:所以我能够进入/Propel/runtime/lib/Propel.php
并找到Unable to find adapter
引发异常的行.我通过添加行手动定义变量self::$configuration['datasources'][$name]['adapter'] = 'pgsql'
,它的工作原理.这显然不是现在验证有用,因为我无法在不重做此更改的情况下更新Propel.我倾倒self::$configuration
在Propel.php中,它是NULL
,任何想法为什么?
归档时间: |
|
查看次数: |
1720 次 |
最近记录: |