Skip to content

Instantly share code, notes, and snippets.

@lira92
Last active May 4, 2016 03:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lira92/c1057ba49dd70755896744af62137899 to your computer and use it in GitHub Desktop.
Save lira92/c1057ba49dd70755896744af62137899 to your computer and use it in GitHub Desktop.
Arquivo de Migration
<?php
use Phinx\Migration\AbstractMigration;
class PrimeiraMigration extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('Usuarios');
$table->addColumn('nome', 'string')
->addColumn('senha', 'string')
->create();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment