You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can configure the path, namespace, table_name, name, organize_migrations and custom_template in your ``config.yml``. The examples below are the default values.
36
+
If you use Symfony Flex, the ``doctrine_migrations.yaml`` config file is created
37
+
automatically. Otherwise, create the following file and configure it for your
38
+
application:
52
39
53
40
.. code-block:: yaml
54
41
55
-
#app/config/config.yml
42
+
# config/packages/doctrine_migrations.yaml
56
43
doctrine_migrations:
57
-
dir_name: "%kernel.root_dir%/Migrations"
58
-
namespace: "App\\Migrations"
59
-
table_name: "migration_versions"
60
-
column_name: "version"
44
+
dir_name: '%kernel.project_dir%/src/Migrations'
45
+
# namespace is arbitrary but should be different from App\Migrations
46
+
# as migrations classes should NOT be autoloaded
47
+
namespace: DoctrineMigrations
48
+
table_name: 'migration_versions'
49
+
column_name: 'version'
61
50
column_length: 14
62
-
executed_at_column_name: "executed_at"
63
-
name: Application Migrations
64
-
organize_migrations: false # Version >= 1.2, possible values are: "BY_YEAR", "BY_YEAR_AND_MONTH", false
65
-
custom_template: ~ # Version >= 1.2, path to your custom migrations template
51
+
executed_at_column_name: "'executed_at'
52
+
name: 'Application Migrations'
53
+
# available in version >= 1.2. Possible values: "BY_YEAR", "BY_YEAR_AND_MONTH", false
54
+
organize_migrations: false
55
+
# available in version >= 1.2. Path to your custom migrations template
56
+
custom_template: ~
66
57
all_or_nothing: false
67
58
68
59
Usage
69
60
-----
70
61
71
-
.. caution::
72
-
73
-
If your application is based on Symfony 3, replace ``php app/console`` by
74
-
``php bin/console`` before executing any of the console commands included
75
-
in this article.
76
-
77
62
All of the migrations functionality is contained in a few console commands:
78
63
79
64
.. code-block:: bash
@@ -95,7 +80,7 @@ the ``status`` command:
95
80
96
81
.. code-block:: bash
97
82
98
-
$ php app/console doctrine:migrations:status
83
+
$ php bin/console doctrine:migrations:status
99
84
100
85
== Configuration
101
86
@@ -123,7 +108,7 @@ for you.
123
108
124
109
.. code-block:: bash
125
110
126
-
$ php app/console doctrine:migrations:generate
111
+
$ php bin/console doctrine:migrations:generate
127
112
Generated new migration class to "/path/to/project/app/Migrations/Version20180605025653.php"
128
113
129
114
To run just this migration for testing purposes, you can use migrations:execute --up 20180605025653
0 commit comments