Location: PHPKode > scripts > Phinx > phinx-0.2.x-dev/tests/Phinx/Migration/_files/reversiblemigrations/20121224200852_create_user_logins_table.php
<?php

use Phinx\Migration\AbstractMigration;

class CreateUserLoginsTable extends AbstractMigration
{
    /**
     * Change.
     */
    public function change()
    {
        // user logins table
        $table = $this->table('user_logins');
        $table->addColumn('user_id', 'integer')
              ->addColumn('created', 'datetime')
              ->create();

        // add a foreign key back to the users table
        $table->addForeignKey('user_id', 'users', array('id'))
              ->update();
    }
    
    /**
     * Migrate Up.
     */
    public function up()
    {
    
    }

    /**
     * Migrate Down.
     */
    public function down()
    {

    }
}
Return current item: Phinx