Skip to content

Commit dd047eb

Browse files
Merge pull request #122 from TheDragonCode/4.x
Removed mention of old migration mechanics
2 parents 3e60208 + 11bd863 commit dd047eb

File tree

12 files changed

+218
-218
lines changed

12 files changed

+218
-218
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ body:
2020
value: |
2121
- PHP Version:
2222
- Database Driver & Version:
23-
- Migration Actions Version:
23+
- Actions Version:
2424
- Laravel Version:
2525
validations:
2626
required: true

docs/how-to-use/rollback.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,16 @@ database:
5555
php artisan actions:refresh
5656
```
5757

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-
re-migrate the last five actions:
58+
You may roll back & re-run a limited number of actions by providing the `step` option to the `refresh` command. For example, the following command will roll back &
59+
re-run the last five actions:
6060

6161
```
6262
php artisan actions:refresh --step=5
6363
```
6464

6565
## Drop All Actions & Rerun Actions
6666

67-
The `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 actions command:
6868

6969
```
7070
php artisan actions:fresh

docs/how-to-use/running.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ bar/2022_10_14_000003_test3 # 3
2424

2525
## Isolating Action Execution
2626

27-
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
27+
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 run
2828
the database at the same time. To avoid this, you may use the `isolated` option when invoking the `actions` command.
2929

3030
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
@@ -120,7 +120,7 @@ return new class extends Action
120120

121121
If the value is `$once = false`, the `up` method will be called every time the `actions` command called.
122122

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.
123+
In this case, information about it will not be written to the `actions` table and, therefore, the `down` method will not be called when the rollback command is called.
124124

125125
> Note
126126
>

ide.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"codeGenerations": [
44
{
55
"id": "dragon-code.create-action",
6-
"name": "Create Migration Action",
7-
"inputFilter": "migration",
6+
"name": "Create Action",
7+
"inputFilter": "actions",
88
"files": [
99
{
1010
"directory": "/actions",

tests/Commands/ActionsTest.php

Lines changed: 140 additions & 140 deletions
Large diffs are not rendered by default.

tests/Commands/FreshTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ public function testFreshCommand(): void
2828

2929
$this->assertDatabaseHasTable($this->table);
3030
$this->assertDatabaseCount($this->table, 1);
31-
$this->assertDatabaseMigrationHas($this->table, 'fresh');
31+
$this->assertDatabaseActionHas($this->table, 'fresh');
3232
}
3333
}

tests/Commands/RefreshTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ public function testRefreshCommand()
2626

2727
$this->assertDatabaseHasTable($this->table);
2828
$this->assertDatabaseCount($this->table, 1);
29-
$this->assertDatabaseMigrationHas($this->table, 'refresh');
29+
$this->assertDatabaseActionHas($this->table, 'refresh');
3030
}
3131
}

tests/Commands/ResetTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ public function testResetCommand()
2121

2222
$this->assertDatabaseHasTable($this->table);
2323
$this->assertDatabaseCount($this->table, 1);
24-
$this->assertDatabaseMigrationHas($this->table, 'reset');
24+
$this->assertDatabaseActionHas($this->table, 'reset');
2525

2626
$this->artisan(Names::RESET)->assertExitCode(0);
2727

2828
$this->assertDatabaseHasTable($this->table);
2929
$this->assertDatabaseCount($this->table, 0);
30-
$this->assertDatabaseMigrationDoesntLike($this->table, 'reset');
30+
$this->assertDatabaseActionDoesntLike($this->table, 'reset');
3131
}
3232
}

tests/Commands/RollbackTest.php

Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ public function testRollbackCommand()
2727
$this->assertDatabaseHasTable($this->table);
2828
$this->assertDatabaseCount($this->table, 2);
2929

30-
$this->assertDatabaseMigrationHas($this->table, 'rollback_one');
31-
$this->assertDatabaseMigrationHas($this->table, 'rollback_two');
32-
$this->assertDatabaseMigrationDoesntLike($this->table, 'rollback_tree');
30+
$this->assertDatabaseActionHas($this->table, 'rollback_one');
31+
$this->assertDatabaseActionHas($this->table, 'rollback_two');
32+
$this->assertDatabaseActionDoesntLike($this->table, 'rollback_tree');
3333

3434
$this->artisan(Names::ROLLBACK)->assertExitCode(0);
3535

@@ -47,9 +47,9 @@ public function testRollbackCommand()
4747
$this->assertDatabaseHasTable($this->table);
4848
$this->assertDatabaseCount($this->table, 3);
4949

50-
$this->assertDatabaseMigrationHas($this->table, 'rollback_one');
51-
$this->assertDatabaseMigrationHas($this->table, 'rollback_two');
52-
$this->assertDatabaseMigrationHas($this->table, 'rollback_tree');
50+
$this->assertDatabaseActionHas($this->table, 'rollback_one');
51+
$this->assertDatabaseActionHas($this->table, 'rollback_two');
52+
$this->assertDatabaseActionHas($this->table, 'rollback_tree');
5353
}
5454

5555
public function testEnvironment()
@@ -62,27 +62,27 @@ public function testEnvironment()
6262

6363
$this->assertDatabaseCount($table, 0);
6464
$this->assertDatabaseCount($this->table, 0);
65-
$this->assertDatabaseMigrationDoesntLike($this->table, 'run_on_all');
66-
$this->assertDatabaseMigrationDoesntLike($this->table, 'run_on_production');
67-
$this->assertDatabaseMigrationDoesntLike($this->table, 'run_on_testing');
68-
$this->assertDatabaseMigrationDoesntLike($this->table, 'run_on_many_environments');
65+
$this->assertDatabaseActionDoesntLike($this->table, 'run_on_all');
66+
$this->assertDatabaseActionDoesntLike($this->table, 'run_on_production');
67+
$this->assertDatabaseActionDoesntLike($this->table, 'run_on_testing');
68+
$this->assertDatabaseActionDoesntLike($this->table, 'run_on_many_environments');
6969
$this->artisan(Names::ACTIONS)->assertExitCode(0);
7070

7171
$this->assertDatabaseCount($table, 5);
7272
$this->assertDatabaseCount($this->table, 12);
73-
$this->assertDatabaseMigrationHas($this->table, 'run_on_all');
74-
$this->assertDatabaseMigrationDoesntLike($this->table, 'run_on_production');
75-
$this->assertDatabaseMigrationHas($this->table, 'run_on_testing');
76-
$this->assertDatabaseMigrationHas($this->table, 'run_on_many_environments');
73+
$this->assertDatabaseActionHas($this->table, 'run_on_all');
74+
$this->assertDatabaseActionDoesntLike($this->table, 'run_on_production');
75+
$this->assertDatabaseActionHas($this->table, 'run_on_testing');
76+
$this->assertDatabaseActionHas($this->table, 'run_on_many_environments');
7777
$this->artisan(Names::ACTIONS)->assertExitCode(0);
7878

7979
$this->artisan(Names::ROLLBACK)->assertExitCode(0);
8080
$this->assertDatabaseCount($table, 10);
8181
$this->assertDatabaseCount($this->table, 0);
82-
$this->assertDatabaseMigrationDoesntLike($this->table, 'run_on_all');
83-
$this->assertDatabaseMigrationDoesntLike($this->table, 'run_on_production');
84-
$this->assertDatabaseMigrationDoesntLike($this->table, 'run_on_testing');
85-
$this->assertDatabaseMigrationDoesntLike($this->table, 'run_on_many_environments');
82+
$this->assertDatabaseActionDoesntLike($this->table, 'run_on_all');
83+
$this->assertDatabaseActionDoesntLike($this->table, 'run_on_production');
84+
$this->assertDatabaseActionDoesntLike($this->table, 'run_on_testing');
85+
$this->assertDatabaseActionDoesntLike($this->table, 'run_on_many_environments');
8686
}
8787

8888
public function testDownSuccess()
@@ -95,17 +95,17 @@ public function testDownSuccess()
9595

9696
$this->assertDatabaseCount($table, 0);
9797
$this->assertDatabaseCount($this->table, 0);
98-
$this->assertDatabaseMigrationDoesntLike($this->table, 'run_success');
98+
$this->assertDatabaseActionDoesntLike($this->table, 'run_success');
9999
$this->artisan(Names::ACTIONS)->assertExitCode(0);
100100

101101
$this->assertDatabaseCount($table, 2);
102102
$this->assertDatabaseCount($this->table, 12);
103-
$this->assertDatabaseMigrationHas($this->table, 'run_success');
103+
$this->assertDatabaseActionHas($this->table, 'run_success');
104104

105105
$this->artisan(Names::ROLLBACK)->assertExitCode(0);
106106
$this->assertDatabaseCount($table, 4);
107107
$this->assertDatabaseCount($this->table, 0);
108-
$this->assertDatabaseMigrationDoesntLike($this->table, 'run_success');
108+
$this->assertDatabaseActionDoesntLike($this->table, 'run_success');
109109
}
110110

111111
public function testDownSuccessOnFailed()
@@ -118,12 +118,12 @@ public function testDownSuccessOnFailed()
118118

119119
$this->assertDatabaseCount($table, 0);
120120
$this->assertDatabaseCount($this->table, 0);
121-
$this->assertDatabaseMigrationDoesntLike($this->table, 'run_success_on_failed');
121+
$this->assertDatabaseActionDoesntLike($this->table, 'run_success_on_failed');
122122
$this->artisan(Names::ACTIONS)->assertExitCode(0);
123123

124124
$this->assertDatabaseCount($table, 2);
125125
$this->assertDatabaseCount($this->table, 12);
126-
$this->assertDatabaseMigrationDoesntLike($this->table, 'run_success_on_failed');
126+
$this->assertDatabaseActionDoesntLike($this->table, 'run_success_on_failed');
127127

128128
try {
129129
$this->copySuccessFailureMethod();
@@ -132,7 +132,7 @@ public function testDownSuccessOnFailed()
132132

133133
$this->assertDatabaseCount($table, 2);
134134
$this->assertDatabaseCount($this->table, 13);
135-
$this->assertDatabaseMigrationHas($this->table, 'run_success_on_failed');
135+
$this->assertDatabaseActionHas($this->table, 'run_success_on_failed');
136136

137137
$this->artisan(Names::ROLLBACK)->assertExitCode(1);
138138
}
@@ -146,7 +146,7 @@ public function testDownSuccessOnFailed()
146146

147147
$this->assertDatabaseCount($table, 2);
148148
$this->assertDatabaseCount($this->table, 13);
149-
$this->assertDatabaseMigrationHas($this->table, 'run_success_on_failed');
149+
$this->assertDatabaseActionHas($this->table, 'run_success_on_failed');
150150
}
151151

152152
public function testDownFailed()
@@ -159,17 +159,17 @@ public function testDownFailed()
159159

160160
$this->assertDatabaseCount($table, 0);
161161
$this->assertDatabaseCount($this->table, 0);
162-
$this->assertDatabaseMigrationDoesntLike($this->table, 'run_failed');
162+
$this->assertDatabaseActionDoesntLike($this->table, 'run_failed');
163163
$this->artisan(Names::ACTIONS)->assertExitCode(0);
164164

165165
$this->assertDatabaseCount($table, 0);
166166
$this->assertDatabaseCount($this->table, 12);
167-
$this->assertDatabaseMigrationHas($this->table, 'run_failed');
167+
$this->assertDatabaseActionHas($this->table, 'run_failed');
168168

169169
$this->artisan(Names::ROLLBACK)->assertExitCode(0);
170170
$this->assertDatabaseCount($table, 0);
171171
$this->assertDatabaseCount($this->table, 0);
172-
$this->assertDatabaseMigrationDoesntLike($this->table, 'run_failed');
172+
$this->assertDatabaseActionDoesntLike($this->table, 'run_failed');
173173
}
174174

175175
public function testUpFailedOnException()
@@ -182,12 +182,12 @@ public function testUpFailedOnException()
182182

183183
$this->assertDatabaseCount($table, 0);
184184
$this->assertDatabaseCount($this->table, 0);
185-
$this->assertDatabaseMigrationDoesntLike($this->table, 'run_failed_failure');
185+
$this->assertDatabaseActionDoesntLike($this->table, 'run_failed_failure');
186186
$this->artisan(Names::ACTIONS)->assertExitCode(0);
187187

188188
$this->assertDatabaseCount($table, 0);
189189
$this->assertDatabaseCount($this->table, 12);
190-
$this->assertDatabaseMigrationDoesntLike($this->table, 'run_failed_failure');
190+
$this->assertDatabaseActionDoesntLike($this->table, 'run_failed_failure');
191191

192192
try {
193193
$this->copyFailedMethod();
@@ -206,7 +206,7 @@ public function testUpFailedOnException()
206206

207207
$this->assertDatabaseCount($table, 1);
208208
$this->assertDatabaseCount($this->table, 13);
209-
$this->assertDatabaseMigrationHas($this->table, 'run_failed_failure');
209+
$this->assertDatabaseActionHas($this->table, 'run_failed_failure');
210210
}
211211

212212
public function testDisabledBefore()
@@ -219,22 +219,22 @@ public function testDisabledBefore()
219219

220220
$this->assertDatabaseCount($table, 0);
221221
$this->assertDatabaseCount($this->table, 0);
222-
$this->assertDatabaseMigrationDoesntLike($this->table, 'test_before_enabled');
223-
$this->assertDatabaseMigrationDoesntLike($this->table, 'test_before_disabled');
222+
$this->assertDatabaseActionDoesntLike($this->table, 'test_before_enabled');
223+
$this->assertDatabaseActionDoesntLike($this->table, 'test_before_disabled');
224224
$this->artisan(Names::ACTIONS)->assertExitCode(0);
225225

226226
$this->assertDatabaseCount($table, 2);
227227
$this->assertDatabaseCount($this->table, 12);
228-
$this->assertDatabaseMigrationHas($this->table, 'test_before_enabled');
229-
$this->assertDatabaseMigrationHas($this->table, 'test_before_disabled');
228+
$this->assertDatabaseActionHas($this->table, 'test_before_enabled');
229+
$this->assertDatabaseActionHas($this->table, 'test_before_disabled');
230230
$this->artisan(Names::ACTIONS)->assertExitCode(0);
231231

232232
$this->artisan(Names::ROLLBACK)->assertExitCode(0);
233233

234234
$this->assertDatabaseCount($table, 4);
235235
$this->assertDatabaseCount($this->table, 0);
236-
$this->assertDatabaseMigrationDoesntLike($this->table, 'test_before_enabled');
237-
$this->assertDatabaseMigrationDoesntLike($this->table, 'test_before_disabled');
236+
$this->assertDatabaseActionDoesntLike($this->table, 'test_before_enabled');
237+
$this->assertDatabaseActionDoesntLike($this->table, 'test_before_disabled');
238238
}
239239

240240
public function testEnabledBefore()
@@ -247,22 +247,22 @@ public function testEnabledBefore()
247247

248248
$this->assertDatabaseCount($table, 0);
249249
$this->assertDatabaseCount($this->table, 0);
250-
$this->assertDatabaseMigrationDoesntLike($this->table, 'test_before_enabled');
251-
$this->assertDatabaseMigrationDoesntLike($this->table, 'test_before_disabled');
250+
$this->assertDatabaseActionDoesntLike($this->table, 'test_before_enabled');
251+
$this->assertDatabaseActionDoesntLike($this->table, 'test_before_disabled');
252252
$this->artisan(Names::ACTIONS, ['--before' => true])->assertExitCode(0);
253253

254254
$this->assertDatabaseCount($table, 1);
255255
$this->assertDatabaseCount($this->table, 11);
256-
$this->assertDatabaseMigrationHas($this->table, 'test_before_enabled');
257-
$this->assertDatabaseMigrationDoesntLike($this->table, 'test_before_disabled');
256+
$this->assertDatabaseActionHas($this->table, 'test_before_enabled');
257+
$this->assertDatabaseActionDoesntLike($this->table, 'test_before_disabled');
258258
$this->artisan(Names::ACTIONS, ['--before' => true])->assertExitCode(0);
259259

260260
$this->artisan(Names::ROLLBACK)->assertExitCode(0);
261261

262262
$this->assertDatabaseCount($table, 2);
263263
$this->assertDatabaseCount($this->table, 0);
264-
$this->assertDatabaseMigrationDoesntLike($this->table, 'test_before_enabled');
265-
$this->assertDatabaseMigrationDoesntLike($this->table, 'test_before_disabled');
264+
$this->assertDatabaseActionDoesntLike($this->table, 'test_before_enabled');
265+
$this->assertDatabaseActionDoesntLike($this->table, 'test_before_disabled');
266266
}
267267

268268
public function testDI(): void
@@ -275,32 +275,32 @@ public function testDI(): void
275275

276276
$this->assertDatabaseCount($table, 0);
277277
$this->assertDatabaseCount($this->table, 0);
278-
$this->assertDatabaseMigrationDoesntLike($this->table, 'invoke');
279-
$this->assertDatabaseMigrationDoesntLike($this->table, 'invoke_down');
280-
$this->assertDatabaseMigrationDoesntLike($this->table, 'up_down');
281-
$this->assertDatabaseMigrationDoesntLike($table, 'up_down', column: 'value');
282-
$this->assertDatabaseMigrationDoesntLike($table, 'invoke_down', column: 'value');
283-
$this->assertDatabaseMigrationDoesntLike($table, 'invoke', column: 'value');
278+
$this->assertDatabaseActionDoesntLike($this->table, 'invoke');
279+
$this->assertDatabaseActionDoesntLike($this->table, 'invoke_down');
280+
$this->assertDatabaseActionDoesntLike($this->table, 'up_down');
281+
$this->assertDatabaseActionDoesntLike($table, 'up_down', column: 'value');
282+
$this->assertDatabaseActionDoesntLike($table, 'invoke_down', column: 'value');
283+
$this->assertDatabaseActionDoesntLike($table, 'invoke', column: 'value');
284284
$this->artisan(Names::ACTIONS)->assertExitCode(0);
285285

286286
$this->assertDatabaseCount($table, 3);
287287
$this->assertDatabaseCount($this->table, 3);
288-
$this->assertDatabaseMigrationHas($this->table, 'invoke');
289-
$this->assertDatabaseMigrationHas($this->table, 'invoke_down');
290-
$this->assertDatabaseMigrationHas($this->table, 'up_down');
291-
$this->assertDatabaseMigrationHas($table, 'up_down', column: 'value');
292-
$this->assertDatabaseMigrationHas($table, 'invoke_down', column: 'value');
293-
$this->assertDatabaseMigrationHas($table, 'invoke', column: 'value');
288+
$this->assertDatabaseActionHas($this->table, 'invoke');
289+
$this->assertDatabaseActionHas($this->table, 'invoke_down');
290+
$this->assertDatabaseActionHas($this->table, 'up_down');
291+
$this->assertDatabaseActionHas($table, 'up_down', column: 'value');
292+
$this->assertDatabaseActionHas($table, 'invoke_down', column: 'value');
293+
$this->assertDatabaseActionHas($table, 'invoke', column: 'value');
294294

295295
$this->artisan(Names::ROLLBACK)->assertExitCode(0);
296296

297297
$this->assertDatabaseCount($table, 2);
298298
$this->assertDatabaseCount($this->table, 0);
299-
$this->assertDatabaseMigrationDoesntLike($this->table, 'invoke');
300-
$this->assertDatabaseMigrationDoesntLike($this->table, 'invoke_down');
301-
$this->assertDatabaseMigrationDoesntLike($this->table, 'up_down');
302-
$this->assertDatabaseMigrationDoesntLike($table, 'up_down', column: 'value');
303-
$this->assertDatabaseMigrationHas($table, 'invoke_down', column: 'value');
304-
$this->assertDatabaseMigrationHas($table, 'invoke', column: 'value');
299+
$this->assertDatabaseActionDoesntLike($this->table, 'invoke');
300+
$this->assertDatabaseActionDoesntLike($this->table, 'invoke_down');
301+
$this->assertDatabaseActionDoesntLike($this->table, 'up_down');
302+
$this->assertDatabaseActionDoesntLike($table, 'up_down', column: 'value');
303+
$this->assertDatabaseActionHas($table, 'invoke_down', column: 'value');
304+
$this->assertDatabaseActionHas($table, 'invoke', column: 'value');
305305
}
306306
}

tests/Commands/StatusTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ public function testStatusCommand()
3434

3535
$this->artisan(Names::STATUS)->assertExitCode(0);
3636

37-
$this->assertDatabaseMigrationHas($this->table, 'status');
37+
$this->assertDatabaseActionHas($this->table, 'status');
3838
}
3939
}

0 commit comments

Comments
 (0)