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: docs/how-to-use/rollback.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,41 +3,41 @@
3
3
To roll back the latest action operation, you may use the `rollback` command. This command rolls back the last "batch" of actions, which may include multiple action files:
4
4
5
5
```
6
-
php artisan migrate:actions:rollback
6
+
php artisan actions:rollback
7
7
```
8
8
9
9
You may roll back a limited number of actions by providing the `step` option to the rollback command. For example, the following command will roll back the last five actions:
10
10
11
11
```
12
-
php artisan migrate:actions:rollback --step=5
12
+
php artisan actions:rollback --step=5
13
13
```
14
14
15
-
The `migrate:actions:reset` command will roll back all of your application's actions:
15
+
The `actions:reset` command will roll back all of your application's actions:
The `migrate:actions:refresh` command will roll back all of your actions and then execute the `migrate:actions` command. This command effectively re-creates your entire
51
+
The `actions:refresh` command will roll back all of your actions and then execute the `actions` command. This command effectively re-creates your entire
52
52
database:
53
53
54
54
```
55
-
php artisan migrate:actions:refresh
55
+
php artisan actions:refresh
56
56
```
57
57
58
58
You may roll back & re-migrate a limited number of actions by providing the `step` option to the `refresh` command. For example, the following command will roll back &
59
59
re-migrate the last five actions:
60
60
61
61
```
62
-
php artisan migrate:actions:refresh --step=5
62
+
php artisan actions:refresh --step=5
63
63
```
64
64
65
65
## Drop All Actions & Rerun Actions
66
66
67
-
The `migrate:actions:fresh` command will drop all actions records from the actions table and then execute the migrate command:
67
+
The `actions:fresh` command will drop all actions records from the actions table and then execute the migrate command:
If you are deploying your application across multiple servers and running actions as part of your deployment process, you likely do not want two servers attempting to migrate
28
-
the database at the same time. To avoid this, you may use the `isolated` option when invoking the `migrate:actions` command.
28
+
the database at the same time. To avoid this, you may use the `isolated` option when invoking the `actions` command.
29
29
30
30
When the `isolated` option is provided, Laravel will acquire an atomic lock using your application's cache driver before attempting to run your actions. All other attempts to
31
-
run the `migrate:actions` command while that lock is held will not execute; however, the command will still exit with a successful exit status code:
31
+
run the `actions` command while that lock is held will not execute; however, the command will still exit with a successful exit status code:
32
32
33
33
```bash
34
-
php artisan migrate:actions --isolated
34
+
php artisan actions --isolated
35
35
```
36
36
37
37
## Split Launch Option
@@ -41,10 +41,10 @@ Sometimes it becomes necessary to launch actions separately, for example, to not
41
41
There is a `before` option for this when calling actions:
42
42
43
43
```bash
44
-
php artisan migrate:actions --before
44
+
php artisan actions --before
45
45
```
46
46
47
-
When calling the `migrate:actions` command with the `before` parameter, the script will execute only those actions within which the value of the `before` parameter is `true`.
47
+
When calling the `actions` command with the `before` parameter, the script will execute only those actions within which the value of the `before` parameter is `true`.
48
48
49
49
For backwards compatibility, the `before` parameter is set to `true` by default, but actions will only be executed if the option is explicitly passed.
50
50
@@ -71,31 +71,31 @@ To run, you need to pass the `before` parameter. For example, when using [`deplo
71
71
task('deploy', [
72
72
// ...
73
73
'artisan:migrate',
74
-
'artisan:migrate:actions --before', // here
74
+
'artisan:actions --before', // here
75
75
'deploy:publish',
76
76
'php-fpm:reload',
77
77
'artisan:queue:restart',
78
-
'artisan:migrate:actions', // here
78
+
'artisan:actions', // here
79
79
]);
80
80
```
81
81
82
-
Thus, when `migrate:actions` is called, all actions whose `before` parameter is `true` will be executed, and after that, the remaining tasks will be executed.
82
+
Thus, when `actions` is called, all actions whose `before` parameter is `true` will be executed, and after that, the remaining tasks will be executed.
83
83
84
84
> Note:
85
-
> If you call the `migrate:actions` command without the `before` parameter,
85
+
> If you call the `actions` command without the `before` parameter,
86
86
> then all tasks will be executed regardless of the value of the `$before`
87
87
> attribute inside the action class.
88
88
89
89
## Forcing Actions To Run In Production
90
90
91
91
> Some commands cannot be executed in production without confirmation.
92
-
> These include all commands except `migrate:actions:status` and `migrate:actions`.
92
+
> These include all commands except `actions:status` and `actions`.
93
93
94
94
Some action operations are destructive, which means they may cause you to lose data. In order to protect you from running these commands against your production database,
95
95
you will be prompted for confirmation before the commands are executed. To force the commands to run without a prompt, use the `--force` flag:
96
96
97
97
```bash
98
-
php artisan migrate:actions:install --force
98
+
php artisan actions:install --force
99
99
```
100
100
101
101
## Execution Every Time
@@ -118,7 +118,7 @@ return new class extends Action
118
118
};
119
119
```
120
120
121
-
If the value is `$once = false`, the `up` method will be called every time the `migrate:actions` command called.
121
+
If the value is `$once = false`, the `up` method will be called every time the `actions` command called.
122
122
123
123
In this case, information about it will not be written to the `migration_actions` table and, therefore, the `down` method will not be called when the rollback command is called.
0 commit comments