Posts

Showing posts with the label Migrations

How to Use doctrine:migrations:rollup Command

During the development process, a large number of migrations are created, but rollbacks are not often used or not used at all. Instead of creating another migration, it's better to create one single migration that will include all past database schema changes. That's what the doctrine:migrations:rollup command is for. The doctrine:migrations:rollup command does the following: Check that there is only one migration in the migrations directory Delete executed migrations from the doctrine_migration_versions table Will add a single migration to the doctrine_migration_versions table, but will not execute it A single migration will not be executed because it is expected that all previous migrations were executed earlier, and the migration itself contains the up-to-date database schema. Steps to run doctrine:migrations:rollup command: DEV environment Dump database data using pg_dumpall -a -U USERNAME > dump.sql command Drop all tables and sequences: dr...