Posts Tagged ‘propel’

Interesting symfony plugins: sfPropelMigrationsLightPlugin

You probably have read about all the buzz surrounding Doctrine these days. Its support for migrations (the ability to upgrade/downgrade the database schema) is pretty awesome. However, migrating to Doctrine from Propel 1.4 can be challenging on a large scale project. Don’t fret, it turns out that there is a cool little plugin that provides migrations for those that are locked in the Propel world. As described in the plugin page, the sfPropelMigrationsLightPlugin allows to “Easily change the database structure without losing any data.”

The main difference between Doctrine’s migrations and sfPropelMigrationsLightPlugin is that you have to write the code to alter your tables, where as Doctrine can generate these by looking at the differences in the local schema file and the DB. The plugin page describes the use which is fairly simple: create the migration class, add the code to the up() and down() methods and finally run the migrate task (ie. symfony migrate frontend 42)

Automating the deployment process is an important part of delivering software and avoiding problems. This plugin surely helps in this regard and we recommend its use if you are using Propel. And remember to always backup before you migrate anything!

06

04 2010

Obscure propel error: Bus error

Recently, I was starting a new symfony project and after creating the db schema, I run the usual command:

symfony propel-build-model

The output was somewhat different from the normal result:

>> schema    converting "/Users/pgodel/com/s...ntact/config/schema.yml" to XML
>> schema    putting /Users/pgodel/com/sites...act/config/generated-schema.xml
>> propel    Running "om" phing task
Bus error

This was weird and unexpected. I run this command all the time and never had any issues. After the mandatory google search I found:

  • someone suggesting that the problem was due to a timestamp field with a default CURRENT_TIMESTAMP. This was not my case.
  • a few poeple having a similar issue while using Mac OSX, which I was. Their discussion pointed to XML and XSLT libraries version conflicts. I tried their suggestion but the new ‘Bus error’ friend was still showing up.

Then I kept thinking why this would be happening now, what was different in my setup, and the only big difference I could think of was that I was using Zend Server CE, and the PHP installation that came with it. I noticed that the XSLT library included was different from my system’s version.

I decided to download the latest version of Zend Server CE and luckly that fixed the problem.

Tags: ,

13

08 2009