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
Copy file name to clipboardExpand all lines: user_guide_src/source/dbmgmt/migration.rst
+21-16Lines changed: 21 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,9 +67,13 @@ Database Groups
67
67
68
68
A migration will only be run against a single database group. If you have multiple groups defined in
69
69
**app/Config/Database.php**, then it will run against the ``$defaultGroup`` as specified
70
-
in that same configuration file. There may be times when you need different schemas for different
70
+
in that same configuration file.
71
+
72
+
There may be times when you need different schemas for different
71
73
database groups. Perhaps you have one database that is used for all general site information, while
72
-
another database is used for mission critical data. You can ensure that migrations are run only
74
+
another database is used for mission critical data.
75
+
76
+
You can ensure that migrations are run only
73
77
against the proper group by setting the ``$DBGroup`` property on your migration. This name must
74
78
match the name of the database group exactly:
75
79
@@ -115,8 +119,8 @@ Migrates a database group with all available migrations:
115
119
116
120
You can use (migrate) with the following options:
117
121
118
-
- ``-g`` - to chose database group, otherwise default database group will be used.
119
-
- ``-n`` - to choose namespace, otherwise (App) namespace will be used.
122
+
- ``-g`` - to specify database group. If specified, only migrations for the specified database group will be run. If not specified, all migrations will be run.
123
+
- ``-n`` - to choose namespace, otherwise ``App`` namespace will be used.
120
124
- ``--all`` - to migrate all namespaces to the latest migration.
121
125
122
126
This example will migrate ``Acme\Blog`` namespace with any new migrations on the test database group:
@@ -140,15 +144,14 @@ to minimize any potential conflicts between the main application and any modules
140
144
rollback
141
145
========
142
146
143
-
Rolls back all migrations, taking the database group to a blank slate, effectively migration 0:
147
+
Rolls back all migrations to a blank slate, effectively migration 0:
144
148
145
149
.. code-block:: console
146
150
147
151
php spark migrate:rollback
148
152
149
153
You can use (rollback) with the following options:
150
154
151
-
- ``-g`` - to choose database group, otherwise default database group will be used.
152
155
- ``-b`` - to choose a batch: natural numbers specify the batch.
153
156
- ``-f`` - to force a bypass confirmation question, it is only asked in a production environment.
154
157
@@ -163,8 +166,8 @@ Refreshes the database state by first rolling back all migrations, and then migr
163
166
164
167
You can use (refresh) with the following options:
165
168
166
-
- ``-g`` - to choose database group, otherwise default database group will be used.
167
-
- ``-n`` - to choose namespace, otherwise (App) namespace will be used.
169
+
- ``-g`` - to specify database group. If specified, only migrations for the specified database group will be run. If not specified, all migrations will be run.
170
+
- ``-n`` - to choose namespace, otherwise ``App`` namespace will be used.
168
171
- ``--all`` - to refresh all namespaces.
169
172
- ``-f`` - to force a bypass confirmation question, it is only asked in a production environment.
170
173
@@ -189,7 +192,7 @@ Displays a list of all migrations and the date and time they ran, or '--' if the
189
192
190
193
You can use (status) with the following options:
191
194
192
-
- ``-g`` - to choose database group, otherwise default database group will be used.
195
+
- ``-g`` - to specify database group. If specified, only migrations for the specified database group will be checked. If not specified, all migrations will be checked.
193
196
194
197
make:migration
195
198
==============
@@ -220,13 +223,15 @@ Migration Preferences
220
223
221
224
The following is a table of all the config options for migrations, available in **app/Config/Migrations.php**.
0 commit comments