I am trying to use migrations for the first time on my in-development Propel project (so I don't have to re-insert 15MB of data), but am having some difficulties. I made the changes in my schema and ran propel-gen diff
. I first received an error that it couldn't locate my buildtime-conf.xml
file. I hadn't made one yet (since it wasn't necessary), but read that the structure should be the same as the runtime-conf.xml
. I copied runtime-conf.xml
to buildtime-conf.xml
. And now receive the following error:
[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.
My runtime and buildtime files look like the following:
<?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>
My schema is along the lines of this:
<?xml version="1.0" encoding="UTF-8"?>
<database name="project" defaultIdMethod="native">
<table schema="accounts" name="accounts" phpName="Account" package="accounts">
<column />
</table>
</database>
I tried changing the buildtime-conf to <datasource id="testing">
and the error changed to Unable to find adapter for datasource [testing]
. So the error lies in the actual buildtime-conf file (not the schema), as far as I can tell. I thought maybe Propel couldn't find PostgreSQL's adapter (even though it works fine in my runtime-conf), so I tried changing my adapter to mysql
. It came up with the same unable to find adapter error.
I'm completely lost, thoughts?
Update: so I was able to go into /Propel/runtime/lib/Propel.php
and locate the line where the Unable to find adapter
exception was thrown. I manually defined the variable by adding the line self::$configuration['datasources'][$name]['adapter'] = 'pgsql'
and it works. This obviously isn't verify useful for now, as I won't be able to update Propel without redoing this change. I dumped self::$configuration
in Propel.php and it is NULL
, any ideas why?