1. From your Ushahidi root folder run this from the commandline:
./bin/phinx create -c application/phinx.php DoSomethingWithTheDb
2. A migration template will be created in this folder:
/migrations/timestamp_migration_name.php
In our example above, the migration template would be created in:
/migrations/
20141105085836_do_something_with_the_db.php
4. Open the template:
<?php use Phinx\Migration\AbstractMigration; class DoSomethingWithTheDb extends AbstractMigration { /** * Change Method. * * More information on this method is available here: * http://docs.phinx.org/en/latest/migrations.html#the-change-method * * Uncomment this method if you would like to use it. * public function change() { } */ /** * Migrate Up. */ public function up() { } /** * Migrate Down. */ public function down() { } } |
5. Add the necessary queries to the up an down methods
6 Next we run the migration