Google News
logo
FuelPHP - Interview Questions
How to Run a Migration in FuelPHP?
A migration can be run in two ways :
 
* Migrate class
* Oil Refine Command

The oil command there uses the Refine command to call the migrate task.
$ php oil refine migrate
$ php oil refine migrate:current
$ php oil refine migrate:up
$ php oil refine migrate:down
$ php oil refine migrate --version=10
Migrations are supported for modules and packages too. You can specify on the oil commandline if you want to migrate all, or only specific modules and/or packages. If you do, you can use '--default' to indicate you want to include app migrations.
$ php oil refine migrate -all
$ php oil refine migrate --modules=module1,module2 --packages=package1
$ php oil refine migrate:up --packages=package1
$ php oil refine migrate:down --modules=module1,module2 --default
$ php oil refine migrate --version=10
Advertisement