[Flow] Flow: mysterious migration commands
David Sporer
david.sporer at gmail.com
Mon May 11 21:24:36 CEST 2015
Hi Jan,
the difference between doctrine:update and doctrine:migrate is (as far as I know) that doctrine:update just goes through all your models, checks if there are any properties defined in the model that are not yet in the database and creates them.
doctrine:migrate just executes all migrations that are located in the Migration/Mysql folder of your package.
The preferred workflow is as soon as you made changes to your models, execute doctrine:migrationgenerate. This will create a migration-file inside the Data/DoctrineMigrations folder.
You should now check if the migration folder creates everything as you want it to and update the file if necessary (e.g. if you have an old field that you want to move data over to the new one).
Afterwards copy the automatically generated file to the Migration/Mysql folder of your package and execute doctrine:migrate.
This will then add or update the fields in the database.
You should always use doctrine:migrate instead of update because it gives you much more control over what is happening in the background. Also you can roll back changes and use the migrate-command for automated deployment.
Hope that helps a bit. I’m sure there are some things I forgot to mention but maybe someone of the other guys can explain things in more detail.
Regards,
David
> Am 11.05.2015 um 15:23 schrieb Jan Greth <jan at greth.me>:
>
> Hello Community!
>
> I have some problems understanding the whole Floe migrationcommand (doctrine:migrate, doctrine:migrationstatus, doctrine:migrationexecute, doctrine:migrationgenerate, doctrine:migrationversion, ...)thing and hope you can help me clear things out. So here are my questions:
>
> First, can you explain, what's the difference between doctrine:migrate and doctrine:update ?
>
> And to get in depth with the migration stuff: Can someone explain in simple words, what migrations in Flow are? When do i have to use it? And what ist the preferred Workflow?
>
> I often simply read "instead of using doctrine:update use doctrine:migrate"... why?
>
> I hope someone can help me,
> greetings,
> Jan
> _______________________________________________
> Flow mailing list
> Flow at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow
More information about the Flow
mailing list