tags:

views:

10

answers:

1

Is it possible to make

propel-gen insert-sql

without loosing previous data?

Any hack?

I usually just add or remove some rows in a table editing schema.xml executing:

propel-gen
propel-gen sql
propel-gen insert-sql

and this wipes-out all the data wich is annoying!

Thank you!

A: 

For this to work, Propel should know what has changed and only execute those changes. For example, if you change the name of a column, Propel only sees the new schema and has no way of knowing whether you just changed the name or deleted the old column and added a new one.

You want to migrate, or "update" your database from one version to another. Propel 1.6 (not yet released) will have this built-in, but there is an older Symfony plugin that adds simple migration support. You write the SQL queries to change the database yourself. This is not as automated as you might want, but it probably means that it will still work with the current version of Symfony and Propel.

Jan Fabry