Added provider and provider_data columns to user.

This commit is contained in:
Adirelle 2015-03-08 17:20:16 +01:00 committed by Dmitry Khomutov
commit d901ca74ab
No known key found for this signature in database
GPG key ID: 7EB36C9576F9ECB9
2 changed files with 151 additions and 31 deletions

View file

@ -0,0 +1,41 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
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', array(
'default' => 'internal',
'limit' => MysqlAdapter::TEXT_SMALL
))
// A data used by the provider
->addColumn('provider_data', 'string', array(
'null' => true,
'limit' => MysqlAdapter::TEXT_SMALL
))
->save();
}
/**
* Migrate Down.
*/
public function down()
{
// Remove the provider columns
$this
->table('user')
->removeColumn('provider_key')
->removeColumn('provider_data')
->save();
}
}