Migrate to a certain file |
Let's say I have 10 migrations files in the folder "App/Database/Migrations and everyone is migrated. Now I like to rollback to the migration nr 7. How can I do that from a controller in CI4?
In CI3 I ran Code: $this->migration->version($timestamp); I have problem finding any function that rollbacks migrations the way I want: Method regress() seems to work with batches and groups. I have group 'default' and batch '1' in all my files, so that's not for me. Method force() might work, but how do I pass in the namespace as the second argument? force('App\Database\Migrations\Add_something,) The following ugly script throws the error "Migration file not found": PHP Code: <?php namespace App\Controllers; "Migrations (to keep order, only migrate one step up/down at a time. I will restrict links someday): C:\xampp\htdocs\ci4\app\Database\Migrations\20100101000000_add_dummy.phpMigrate this file C:\xampp\htdocs\ci4\app\Database\Migrations\20100101000002_add_hobby.phpMigrate this file C:\xampp\htdocs\ci4\app\Database\Migrations\20100101000003_add_human.phpMigrate this file LATEST C:\xampp\htdocs\ci4\app\Database\Migrations\20100101000004_add_another_human.phpMigrate this file" |
Messages In This Thread |
Migrate to a certain file - by muuucho - 10-05-2020, 04:34 AM
RE: Migrate to a certain file - by T.O.M. - 10-09-2020, 12:52 AM
|