Hi Joe,

for me this works really well:
add the column to the table in schema.yml
DO NOT ./symfony doctrine:build --all-classes
BUT
./symfony doctrine:generate-migrations-diff
AND NOW ./symfony doctrine:build --all-classes

Now you should be able to run
./symfony doctrine:migrate

BTW: Delete all old migration files before doing this. And you db user
needs the rights to add tables the first time you run migrations.

HTH

PS: The migration files name's start with a timestamp. From this
timestamp doctrine determines in which order to run the migrations (if
you have more than one migration file), and which version of the
database. The first time when you run a migration, doctrine creates a
table migration_version where it keeps the database's version.


Am 13.07.2010 17:22, schrieb Joe:
> Hey everyone,
> 
> I am maintaining a Symfony 1.4 application. I need to add a column to
> an existing table in production database. I am trying to use Doctrine
> migration ability to do so.
> 
> My first command was:
> php symfony doctrine:generate-migrations-db.
> 
> I get the error: Could not generate migration classes from database
> 
> 
> 
> I then tried to generate my own migration class:
> php symfony doctrine:generate-migration AddMymoduleMyfield
> 
> Class was generated as well as 91 others that re-create my complete
> database (isn't this supposed to be the result of the first command ?)
> Problem is, as soon as I launch:
> php symfony doctrine:migrate
> 
> Here's the output I get:
> 
>>> doctrine  Migrating from version 1 to 92
> 
> I then get error saying that table already exists. So I gather
> migration is going to try to recreate databases from start, and
> PostgreSQL returning 'already exists' error.
> 
> Simply put, is there a way to ask Symfony to migrate from version 91
> to 92 (instead of 1 to 92) ??
> 

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to