Skip to content

Commit ff5f8ee

Browse files
committed
Add doc for "doctrine:migrations:version" command
Ref #148
1 parent 86d2b1c commit ff5f8ee

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Resources/doc/index.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,18 @@ table of your production database. Regardless of what server you're on, you
177177
can always safely run this command to execute only the migrations that haven't
178178
been run yet on *that* particular database.
179179

180+
Skipping Migrations
181+
~~~~~~~~~~~~~~~~~~~
182+
183+
You can skip single migrations by explicitely adding them to the ``migration_versions`` table:
184+
185+
.. code-block:: bash
186+
187+
$ php app/console doctrine:migrations:version YYYYMMDDHHMMSS --add
188+
189+
Doctrine will then assume that this migration has already been run and will ignore it.
190+
191+
180192
Generating Migrations Automatically
181193
-----------------------------------
182194

@@ -277,6 +289,15 @@ to create a fresh database and run your migrations in order to get your database
277289
schema fully up to date. In fact, this is an easy and dependable workflow
278290
for your project.
279291

292+
If you don't want to use this workflow and instead create your schema via
293+
``doctrine:schema:create``, you can tell Doctrine to skip all existing migrations:
294+
295+
.. code-block:: bash
296+
297+
$ php app/console doctrine:migrations:version --add --all
298+
299+
Otherwise Doctrine will try to run all migrations, which probably will not work.
300+
280301
Container Aware Migrations
281302
--------------------------
282303

0 commit comments

Comments
 (0)