Added provider and provider_data columns to user.
This commit is contained in:
parent
ff74b2f0c5
commit
d901ca74ab
2 changed files with 151 additions and 31 deletions
41
PHPCI/Migrations/20150308074509_add_user_providers.php
Normal file
41
PHPCI/Migrations/20150308074509_add_user_providers.php
Normal 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();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue