2015-03-08 17:20:16 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Phinx\Migration\AbstractMigration;
|
|
|
|
|
|
|
|
class AddUserProviders extends AbstractMigration
|
|
|
|
{
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
// Add the provider columns
|
|
|
|
$this
|
|
|
|
->table('user')
|
|
|
|
// The provider name
|
2017-01-07 18:55:56 +01:00
|
|
|
->addColumn('provider_key', 'string', [
|
2015-03-08 17:20:16 +01:00
|
|
|
'default' => 'internal',
|
2017-01-29 03:49:43 +01:00
|
|
|
'limit' => 255
|
2017-01-07 18:55:56 +01:00
|
|
|
])
|
2015-03-08 17:20:16 +01:00
|
|
|
// A data used by the provider
|
2017-01-07 18:55:56 +01:00
|
|
|
->addColumn('provider_data', 'string', [
|
|
|
|
'null' => true,
|
2017-01-29 03:49:43 +01:00
|
|
|
'limit' => 255
|
2017-01-07 18:55:56 +01:00
|
|
|
])
|
2015-03-08 17:20:16 +01:00
|
|
|
->save();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
// Remove the provider columns
|
|
|
|
$this
|
|
|
|
->table('user')
|
|
|
|
->removeColumn('provider_key')
|
|
|
|
->removeColumn('provider_data')
|
|
|
|
->save();
|
|
|
|
}
|
|
|
|
}
|