Skip to content

Commit

Permalink
Merge pull request #731 from doctrine/all-or-nothing-docs
Browse files Browse the repository at this point in the history
Add more documentation for all or nothing transaction functionality.
  • Loading branch information
jwage authored Jun 7, 2018
2 parents 0d8c6c5 + 66505d6 commit f9fe959
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions docs/en/reference/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,31 @@ classes using the ``migrations`` configuration setting:
}
}
All or Nothing Transaction
--------------------------

.. note::

This is only works if your database supports transactions for DDL statements.

When using the ``all_or_nothing`` option, multiple migrations ran at the same time will be wrapped in a single
transaction. If one migration fails, all migrations will be rolled back

From the Command Line
~~~~~~~~~~~~~~~~~~~~~

You can also set this option from the command line with the ``migrate`` command and the ``--all-or-nothing`` option:

.. code-block:: sh
$ ./vendor/bin/doctrine-migrations migrate --all-or-nothing
If you have it enabled at the configuration level and want to change it for an individual migration you can
pass a value of ``0`` or ``1`` to ``--all-or-nothing``.

.. code-block:: sh
$ ./vendor/bin/doctrine-migrations migrate --all-or-nothing=0
Connection Configuration
------------------------
Expand Down

0 comments on commit f9fe959

Please sign in to comment.