dev-master
9999999-devDatabase migration and seeder for Kohana's Minion task runner.
MIT
The Requires
- php >=5.4.0
- composer/installers ~1.0
- evopix/kohana-schema *
Database migration and seeder for Kohana's Minion task runner.
The Minion Database module provides a database agnostic way of modifying the database schema and staying up to date on the current schema state., (*2)
To create a migration, you may use the migration:make
task on the Minion CLI:, (*4)
minion migration:make --group=foo
The migration will be placed in the application/database/migrations/foo
directory, and the file name will be a timestamp., (*5)
You may also specify a --description
option when creating a migration to provide context. The description will be appended to the migration filename and included in the migration class comment., (*6)
minion migration:make --group=foo --description="Creating foo table"
Running all required migrations:, (*8)
minion db:migrate
Running all required migrations for a specific group:, (*9)
minion db:migrate --group=foo
Running all required migrations for a multiple groups:, (*10)
minion db:migrate --group=foo,bar
Running a specific migration:, (*11)
minion db:migrate --to=20140327143111
Running the next n
migrations:, (*12)
minion db:migrate --to=+3
Rolling back the last migration:, (*14)
minion db:migrate --to=-1
Rolling back to a specific migration:, (*15)
minion db:migrate --to=20140327143111
Rolling back the last n
migrations:, (*16)
minion db:migrate --to=-3
This module also includes a simple way to seed your database with test data using seed classes. All seed classes are stored in application/database/seeds
. Seed classes are split into groups just like migrations and may have any name you wish, but probably should follow some sensible convention, such as UserTableSeeder, etc. A DatabaseSeeder class is required for each group and it's from this class that you may use the call method to run other seed classes, allowing you to control the seeding order., (*18)
To seed your database, you may use the db:seed command on the Artisan CLI:, (*19)
minion db:seed
You may also specify a single group or multiple groups to seed:, (*20)
minion db:seed --group=foo minion db:seed --group=foo,bar
Database migration and seeder for Kohana's Minion task runner.
MIT