FOR ARCHIVAL PURPOSES ONLY

The information in this wiki hasn't been maintained for a good while. Some of the projects described have since been deprecated.

In particular, the "Ushahidi Platform v3.x" section contains information that is often misleading. Many details about this version of Platform have changed since.

This website is an extraction of the original Ushahidi wiki into a static form. Because of that, functions like logging in, commenting or searching will not work.

For more documentation, please refer to https://docs.ushahidi.com

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

1. From your Ushahidi root folder run this from the commandline:
./minion --task=migrations:new --group=3-0

...

bin/phinx create -c application/phinx.php DoSomethingWithTheDb

2. A migration template will be created in this folder:
/application/migrations/[group]timestamp_migration_name.php

In our example above, the migration template would be created in:
/application/migrations/3-020141105085836_do_something_with_the_db.php

4. Open the template:

Code Block
linenumberstrue
languagephp
<?php
defined('SYSPATH') OR die('No direct script access.')
use Phinx\Migration\AbstractMigration;

class Migration_3_0_20130318155930DoSomethingWithTheDb extends Minion_Migration_BaseAbstractMigration
{
 	   /**
	     * RunChange queriesMethod.
needed to apply this migration
	 *
	 * @param Kohana_Database $db Database connection
	 */
	public function up(Kohana_Database $db)
	{
		// $db->query(NULL, 'CREATE TABLE ... ');
	}

	/**
	 * Run queries needed to remove this migration
	 *
	 * @param Kohana_Database $db Database connection
	 */
	public function down(Kohana_Database $db)
	{
		// $db->query(NULL, 'DROP TABLE ... ');
	}

}
   *
     * 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

...