A Ko3 Module by John Hobbs
This module provides a DSL and tools for database migrations for Kohana 3.1.x.
It is loosely inspired by Ruby's ActiveRecord::Migration
PHP is not a nice language for DSL's, so there are some dirty hacks and it's a bit verbose. Get over it or pick a new language.
Also, be aware that it is totally possible to create SQL statements that just don't work. K3-Migrate is not that bright, it will try to do stupid things if you tell it to (especially with indexes).
- Drop the source in your MODPATH folder.
- Add the module to Kohana::modules in your bootstrap.php
- Create the directory APPPATH/migrations/
There are examples in the examples directory.
In K3-Migrate there is usually more than one way to do something, but there are four core statements, outlined below.
Each statement is nested inside of a Migration object's up or down methods.