Version Numbers =============== When :doc:`Generating Migrations ` the newly created classes are generated with the name ``Version{date}`` with ``{date}`` having a ``YmdHis`` `format `_. This format is important as it allows the migrations to be correctly ordered. .. note:: Starting with version 1.5 when loading migration classes, Doctrine does a ``sort($versions, SORT_STRING)`` on version numbers. This can cause problems with custom version numbers: .. code-block:: php string(8) "Version1" [1] => string(9) "Version10" [2] => string(8) "Version2" } */ The custom version numbers above end up out of order which may cause damage to a database. It is **strongly recommended** that the ``Version{date}`` migration class name format is used and that the various :doc:`tools for generating migrations ` are used. Should some custom migration numbers be necessary, keeping the version number the same length as the date format (14 total characters) and padding it to the left with zeros should work. .. code-block:: php string(21) "Version00000000000001" [1] => string(21) "Version00000000000002" [2] => string(21) "Version00000000000010" [3] => string(21) "Version20180107070000" } */ Please note that migrating to this new, zero-padded format may require :ref:`manual version table intervention ` if the versions have previously been applied. :ref:`Next Chapter: Integrations `