Commit dfb7cf0 1 parent 2b7ad1f commit dfb7cf0 Copy full SHA for dfb7cf0
File tree 1 file changed +16
-0
lines changed
webfiori/database/migration
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -164,6 +164,15 @@ public function apply() : array {
164
164
}
165
165
return $ applied ;
166
166
}
167
+ /**
168
+ * Rollback a set of applied migrations.
169
+ *
170
+ * @param string|null $migrationName If a name is provided, the rollback will
171
+ * be till reaching the specified migration.
172
+ *
173
+ * @return array The method will return an array that holds all rolled back migrations
174
+ * as objects of type 'AbstractMigration'.
175
+ */
167
176
public function rollbackUpTo (?string $ migrationName ) : array {
168
177
$ migrations = $ this ->getMigrations ();
169
178
$ count = count ($ migrations );
@@ -194,6 +203,13 @@ public function rollbackUpTo(?string $migrationName) : array {
194
203
}
195
204
return $ rolled ;
196
205
}
206
+ /**
207
+ * Rollback one single migration.
208
+ *
209
+ * @return AbstractMigration|null If a migration was rolled back, the method
210
+ * will return the migration as an object of type 'AbstractMigration'. Other than that,
211
+ * null is returned.
212
+ */
197
213
public function rollback () : ?AbstractMigration {
198
214
$ migrations = $ this ->getMigrations ();
199
215
$ count = count ($ migrations );
You can’t perform that action at this time.
0 commit comments