php-censor/src/PHPCensor/Migrations/20150308074509_add_user_providers.php
2017-01-29 18:20:22 +07:00

41 lines
890 B
PHP

<?php
use Phinx\Migration\AbstractMigration;
class AddUserProviders extends AbstractMigration
{
/**
* Migrate Up.
*/
public function up()
{
// Add the provider columns
$this
->table('user')
// The provider name
->addColumn('provider_key', 'string', [
'default' => 'internal',
'limit' => 255
])
// A data used by the provider
->addColumn('provider_data', 'string', [
'null' => true,
'limit' => 255
])
->save();
}
/**
* Migrate Down.
*/
public function down()
{
// Remove the provider columns
$this
->table('user')
->removeColumn('provider_key')
->removeColumn('provider_data')
->save();
}
}