php-censor/src/Migrations/20150308074509_add_user_providers.php

35 lines
818 B
PHP
Raw Permalink Normal View History

<?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', [
'default' => 'internal',
2017-01-29 03:49:43 +01:00
'limit' => 255
2017-01-07 18:55:56 +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
])
->save();
}
public function down()
{
// Remove the provider columns
$this
->table('user')
->removeColumn('provider_key')
->removeColumn('provider_data')
->save();
}
}