dev-master
9999999-dev
MIT
The Requires
- php >=5.4.0
- composer/installers ~1.0
- kohana/core ~3.3.3
- alshabalin/kohana-advanced-orm dev-master
- evopix/kohana-schema dev-master
Advanced Migrations is a migration module for kohana, the true Rails way., (*1)
It uses SQL schemas written by Evopix https://github.com/evopix/kohana-schema, (*2)
Requirements:, (*3)
Features:, (*4)
A typical migration file looks like:, (*5)
class Create_Comments extends Migration { public function up() { Schema::create('comments', function($table) { $table->increments('id'); $table->integer('user_id')->unsigned(); $table->integer('article_id')->unsigned(); $table->text('comment'); $table->enum('status', ['new', 'published', 'banned'])->default('new'); $table->timestamps(); }); Schema::table('articles', function($table) { $table->datetime('last_commented_at')->after('content'); $table->integer('comments_count')->unsigned()->after('content'); }); } public function down() { Schema::drop('comments'); Schema::table('articles', function($table) { $table->drop_column('last_commented_at'); $table->drop_column('comments_count'); }); } } ?>
You may want to create a new migration this way:, (*6)
./minion generate:migration --name=Create_Comments
After all migrations are done, you need to apply all pending migrations:, (*7)
./minion db:migrate
MIT License (c) Alexei Shabalin, 2015, (*8)
MIT