2017 © Pedro Peláez
 

kohana-module minion-database

Database migration and seeder for Kohana's Minion task runner.

image

evopix/minion-database

Database migration and seeder for Kohana's Minion task runner.

  • Wednesday, April 2, 2014
  • by evopix
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Database migration and seeder for Kohana's Minion task runner.


, (*1)

Introduction

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)

, (*3)

Creating Migrations

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"

, (*7)

Running Migrations

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

, (*13)

Rolling Back Migrations

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

, (*17)

Database Seeding

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

The Versions

02/04 2014

dev-master

9999999-dev

Database migration and seeder for Kohana's Minion task runner.

  Sources   Download

MIT

The Requires