Move to raspisms dir

This commit is contained in:
osaajani 2020-02-18 04:29:48 +01:00
parent 34a6f7de65
commit 40fccf133c
278 changed files with 109 additions and 2020 deletions

View file

@ -1,828 +0,0 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class FirstMigration extends Phinx\Migration\AbstractMigration
{
public function change()
{
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('command', [
'id' => false,
'primary_key' => ['id'],
'engine' => 'InnoDB',
'encoding' => 'utf8mb4',
'collation' => 'utf8mb4_general_ci',
'comment' => '',
'row_format' => 'COMPACT',
])
->addColumn('id', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'identity' => 'enable',
])
->addColumn('id_user', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'after' => 'id',
])
->addColumn('name', 'string', [
'null' => false,
'limit' => 25,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'id_user',
])
->addColumn('script', 'string', [
'null' => false,
'limit' => 100,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'name',
])
->addColumn('admin', 'boolean', [
'null' => false,
'limit' => MysqlAdapter::INT_TINY,
'after' => 'script',
])
->addIndex(['id_user', 'name'], [
'name' => 'id_user',
'unique' => true,
])
->create();
$this->table('conditional_group', [
'id' => false,
'primary_key' => ['id'],
'engine' => 'InnoDB',
'encoding' => 'utf8mb4',
'collation' => 'utf8mb4_general_ci',
'comment' => '',
'row_format' => 'COMPACT',
])
->addColumn('id', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'identity' => 'enable',
])
->addColumn('id_user', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'after' => 'id',
])
->addColumn('name', 'string', [
'null' => false,
'limit' => 100,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'id_user',
])
->addColumn('condition', 'text', [
'null' => false,
'limit' => 65535,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'name',
])
->addIndex(['id_user', 'name'], [
'name' => 'id_user',
'unique' => true,
])
->create();
$this->table('contact', [
'id' => false,
'primary_key' => ['id'],
'engine' => 'InnoDB',
'encoding' => 'utf8mb4',
'collation' => 'utf8mb4_general_ci',
'comment' => '',
'row_format' => 'COMPACT',
])
->addColumn('id', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'identity' => 'enable',
])
->addColumn('id_user', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'after' => 'id',
])
->addColumn('name', 'string', [
'null' => false,
'limit' => 100,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'id_user',
])
->addColumn('number', 'string', [
'null' => false,
'limit' => 20,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'name',
])
->addColumn('datas', 'text', [
'null' => true,
'limit' => 65535,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'number',
])
->addIndex(['id_user', 'name'], [
'name' => 'id_user',
'unique' => true,
])
->create();
$this->table('event', [
'id' => false,
'primary_key' => ['id'],
'engine' => 'InnoDB',
'encoding' => 'utf8mb4',
'collation' => 'utf8mb4_general_ci',
'comment' => '',
'row_format' => 'COMPACT',
])
->addColumn('id', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'identity' => 'enable',
])
->addColumn('id_user', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'after' => 'id',
])
->addColumn('type', 'string', [
'null' => false,
'limit' => 25,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'id_user',
])
->addColumn('at', 'timestamp', [
'null' => false,
'default' => 'CURRENT_TIMESTAMP',
'after' => 'type',
])
->addColumn('text', 'string', [
'null' => false,
'limit' => 255,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'at',
])
->addIndex(['id_user'], [
'name' => 'id_user',
'unique' => false,
])
->create();
$this->table('group', [
'id' => false,
'primary_key' => ['id'],
'engine' => 'InnoDB',
'encoding' => 'utf8mb4',
'collation' => 'utf8mb4_general_ci',
'comment' => '',
'row_format' => 'COMPACT',
])
->addColumn('id', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'identity' => 'enable',
])
->addColumn('id_user', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'after' => 'id',
])
->addColumn('name', 'string', [
'null' => false,
'limit' => 100,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'id_user',
])
->addIndex(['id_user', 'name'], [
'name' => 'id_user',
'unique' => true,
])
->create();
$this->table('group_contact', [
'id' => false,
'primary_key' => ['id'],
'engine' => 'InnoDB',
'encoding' => 'utf8mb4',
'collation' => 'utf8mb4_general_ci',
'comment' => '',
'row_format' => 'COMPACT',
])
->addColumn('id', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'identity' => 'enable',
])
->addColumn('id_group', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'after' => 'id',
])
->addColumn('id_contact', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'after' => 'id_group',
])
->addIndex(['id_group'], [
'name' => 'id_group',
'unique' => false,
])
->addIndex(['id_contact'], [
'name' => 'id_contact',
'unique' => false,
])
->create();
$this->table('media', [
'id' => false,
'primary_key' => ['id'],
'engine' => 'InnoDB',
'encoding' => 'utf8mb4',
'collation' => 'utf8mb4_general_ci',
'comment' => '',
'row_format' => 'COMPACT',
])
->addColumn('id', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'identity' => 'enable',
])
->addColumn('id_scheduled', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'after' => 'id',
])
->addColumn('path', 'string', [
'null' => false,
'limit' => 1000,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'id_scheduled',
])
->addIndex(['id_scheduled'], [
'name' => 'id_scheduled',
'unique' => false,
])
->create();
$this->table('phone', [
'id' => false,
'primary_key' => ['id'],
'engine' => 'InnoDB',
'encoding' => 'utf8mb4',
'collation' => 'utf8mb4_general_ci',
'comment' => '',
'row_format' => 'COMPACT',
])
->addColumn('id', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'identity' => 'enable',
])
->addColumn('id_user', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'after' => 'id',
])
->addColumn('number', 'string', [
'null' => false,
'limit' => 25,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'id_user',
])
->addColumn('adapter', 'string', [
'null' => false,
'limit' => 100,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'number',
])
->addColumn('adapter_datas', 'text', [
'null' => true,
'limit' => 65535,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'adapter',
])
->addIndex(['id_user'], [
'name' => 'id_user',
'unique' => false,
])
->create();
$this->table('received', [
'id' => false,
'primary_key' => ['id'],
'engine' => 'InnoDB',
'encoding' => 'utf8mb4',
'collation' => 'utf8mb4_general_ci',
'comment' => '',
'row_format' => 'COMPACT',
])
->addColumn('id', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'identity' => 'enable',
])
->addColumn('at', 'datetime', [
'null' => false,
'after' => 'id',
])
->addColumn('text', 'string', [
'null' => false,
'limit' => 1000,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'at',
])
->addColumn('origin', 'string', [
'null' => false,
'limit' => 20,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'text',
])
->addColumn('destination', 'string', [
'null' => true,
'limit' => 20,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'origin',
])
->addColumn('command', 'boolean', [
'null' => false,
'default' => '0',
'limit' => MysqlAdapter::INT_TINY,
'after' => 'destination',
])
->addColumn('status', 'enum', [
'null' => false,
'default' => 'unread',
'limit' => 6,
'values' => ['read', 'unread'],
'after' => 'command',
])
->create();
$this->table('scheduled', [
'id' => false,
'primary_key' => ['id'],
'engine' => 'InnoDB',
'encoding' => 'utf8mb4',
'collation' => 'utf8mb4_general_ci',
'comment' => '',
'row_format' => 'COMPACT',
])
->addColumn('id', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'identity' => 'enable',
])
->addColumn('id_user', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'after' => 'id',
])
->addColumn('origin', 'string', [
'null' => true,
'limit' => 25,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'id_user',
])
->addColumn('at', 'datetime', [
'null' => false,
'after' => 'origin',
])
->addColumn('text', 'string', [
'null' => false,
'limit' => 1000,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'at',
])
->addColumn('flash', 'boolean', [
'null' => false,
'default' => '0',
'limit' => MysqlAdapter::INT_TINY,
'after' => 'text',
])
->addIndex(['id_user'], [
'name' => 'id_user',
'unique' => false,
])
->create();
$this->table('scheduled_conditional_group', [
'id' => false,
'primary_key' => ['id'],
'engine' => 'InnoDB',
'encoding' => 'utf8mb4',
'collation' => 'utf8mb4_general_ci',
'comment' => '',
'row_format' => 'COMPACT',
])
->addColumn('id', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'identity' => 'enable',
])
->addColumn('id_scheduled', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'after' => 'id',
])
->addColumn('id_conditional_group', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'after' => 'id_scheduled',
])
->addIndex(['id_scheduled'], [
'name' => 'id_scheduled',
'unique' => false,
])
->addIndex(['id_conditional_group'], [
'name' => 'id_conditional_group',
'unique' => false,
])
->create();
$this->table('scheduled_contact', [
'id' => false,
'primary_key' => ['id'],
'engine' => 'InnoDB',
'encoding' => 'utf8mb4',
'collation' => 'utf8mb4_general_ci',
'comment' => '',
'row_format' => 'COMPACT',
])
->addColumn('id', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'identity' => 'enable',
])
->addColumn('id_scheduled', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'after' => 'id',
])
->addColumn('id_contact', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'after' => 'id_scheduled',
])
->addIndex(['id_scheduled'], [
'name' => 'id_scheduled',
'unique' => false,
])
->addIndex(['id_contact'], [
'name' => 'id_contact',
'unique' => false,
])
->create();
$this->table('scheduled_group', [
'id' => false,
'primary_key' => ['id'],
'engine' => 'InnoDB',
'encoding' => 'utf8mb4',
'collation' => 'utf8mb4_general_ci',
'comment' => '',
'row_format' => 'COMPACT',
])
->addColumn('id', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'identity' => 'enable',
])
->addColumn('id_scheduled', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'after' => 'id',
])
->addColumn('id_group', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'after' => 'id_scheduled',
])
->addIndex(['id_scheduled'], [
'name' => 'id_scheduled',
'unique' => false,
])
->addIndex(['id_group'], [
'name' => 'id_group',
'unique' => false,
])
->create();
$this->table('scheduled_number', [
'id' => false,
'primary_key' => ['id'],
'engine' => 'InnoDB',
'encoding' => 'utf8mb4',
'collation' => 'utf8mb4_general_ci',
'comment' => '',
'row_format' => 'COMPACT',
])
->addColumn('id', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'identity' => 'enable',
])
->addColumn('id_scheduled', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'after' => 'id',
])
->addColumn('number', 'string', [
'null' => false,
'limit' => 20,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'id_scheduled',
])
->addIndex(['id_scheduled'], [
'name' => 'id_scheduled',
'unique' => false,
])
->create();
$this->table('sended', [
'id' => false,
'primary_key' => ['id'],
'engine' => 'InnoDB',
'encoding' => 'utf8mb4',
'collation' => 'utf8mb4_general_ci',
'comment' => '',
'row_format' => 'COMPACT',
])
->addColumn('id', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'identity' => 'enable',
])
->addColumn('at', 'datetime', [
'null' => false,
'after' => 'id',
])
->addColumn('text', 'string', [
'null' => false,
'limit' => 1000,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'at',
])
->addColumn('origin', 'string', [
'null' => false,
'limit' => 20,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'text',
])
->addColumn('destination', 'string', [
'null' => true,
'limit' => 20,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'origin',
])
->addColumn('flash', 'boolean', [
'null' => false,
'default' => '0',
'limit' => MysqlAdapter::INT_TINY,
'after' => 'destination',
])
->addColumn('status', 'enum', [
'null' => false,
'default' => 'unknown',
'limit' => 9,
'values' => ['unknown', 'delivered', 'failed'],
'after' => 'flash',
])
->create();
$this->table('setting', [
'id' => false,
'primary_key' => ['id'],
'engine' => 'InnoDB',
'encoding' => 'utf8mb4',
'collation' => 'utf8mb4_general_ci',
'comment' => '',
'row_format' => 'COMPACT',
])
->addColumn('id', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'identity' => 'enable',
])
->addColumn('id_user', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'after' => 'id',
])
->addColumn('name', 'string', [
'null' => false,
'limit' => 50,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'id_user',
])
->addColumn('value', 'string', [
'null' => false,
'limit' => 1000,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'name',
])
->addIndex(['id_user', 'name'], [
'name' => 'id_user',
'unique' => true,
])
->create();
$this->table('smsstop', [
'id' => false,
'primary_key' => ['id'],
'engine' => 'InnoDB',
'encoding' => 'utf8mb4',
'collation' => 'utf8mb4_general_ci',
'comment' => '',
'row_format' => 'COMPACT',
])
->addColumn('id', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'identity' => 'enable',
])
->addColumn('id_user', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'after' => 'id',
])
->addColumn('number', 'string', [
'null' => false,
'limit' => 20,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'id_user',
])
->addIndex(['id_user', 'number'], [
'name' => 'id_user',
'unique' => true,
])
->create();
$this->table('user', [
'id' => false,
'primary_key' => ['id'],
'engine' => 'InnoDB',
'encoding' => 'utf8mb4',
'collation' => 'utf8mb4_general_ci',
'comment' => '',
'row_format' => 'COMPACT',
])
->addColumn('id', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'identity' => 'enable',
])
->addColumn('email', 'string', [
'null' => false,
'limit' => 150,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'id',
])
->addColumn('password', 'string', [
'null' => false,
'limit' => 255,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'email',
])
->addColumn('admin', 'boolean', [
'null' => false,
'default' => '0',
'limit' => MysqlAdapter::INT_TINY,
'after' => 'password',
])
->addColumn('transfer', 'boolean', [
'null' => false,
'default' => '0',
'limit' => MysqlAdapter::INT_TINY,
'after' => 'admin',
])
->addIndex(['email'], [
'name' => 'email',
'unique' => true,
])
->create();
$this->table('validation', [
'id' => false,
'primary_key' => ['id'],
'engine' => 'InnoDB',
'encoding' => 'utf8mb4',
'collation' => 'utf8mb4_general_ci',
'comment' => '',
'row_format' => 'COMPACT',
])
->addColumn('id', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'identity' => 'enable',
])
->addColumn('token', 'string', [
'null' => false,
'limit' => 200,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'id',
])
->addColumn('random', 'string', [
'null' => false,
'limit' => 32,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'token',
])
->addColumn('action', 'string', [
'null' => false,
'limit' => 200,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'random',
])
->addColumn('datas', 'text', [
'null' => false,
'limit' => 65535,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'action',
])
->create();
$this->table('webhook', [
'id' => false,
'primary_key' => ['id'],
'engine' => 'InnoDB',
'encoding' => 'utf8mb4',
'collation' => 'utf8mb4_general_ci',
'comment' => '',
'row_format' => 'COMPACT',
])
->addColumn('id', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'identity' => 'enable',
])
->addColumn('id_user', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'after' => 'id',
])
->addColumn('url', 'string', [
'null' => false,
'limit' => 250,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'id_user',
])
->addColumn('type', 'enum', [
'null' => false,
'limit' => 11,
'values' => ['send_sms', 'receive_sms'],
'after' => 'url',
])
->addIndex(['id_user'], [
'name' => 'id_user',
'unique' => false,
])
->create();
$this->table('webhook_querie', [
'id' => false,
'primary_key' => ['id'],
'engine' => 'InnoDB',
'encoding' => 'utf8mb4',
'collation' => 'utf8mb4_general_ci',
'comment' => '',
'row_format' => 'COMPACT',
])
->addColumn('id', 'integer', [
'null' => false,
'limit' => MysqlAdapter::INT_REGULAR,
'identity' => 'enable',
])
->addColumn('url', 'string', [
'null' => false,
'limit' => 250,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'id',
])
->addColumn('datas', 'string', [
'null' => false,
'limit' => 10000,
'collation' => 'utf8mb4_general_ci',
'encoding' => 'utf8mb4',
'after' => 'url',
])
->create();
}
}

View file

@ -1,40 +0,0 @@
<?php
use Phinx\Migration\AbstractMigration;
class AddSenderAndUidForSended extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* addCustomColumn
* renameColumn
* addIndex
* addForeignKey
*
* Any other destructive changes will result in an error when trying to
* rollback the migration.
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('sended');
$table->addColumn('uid', 'string', ['limit' => 500])
->addColumn('adapter', 'string', ['limit' => 50])
->update();
}
}

View file

@ -1,36 +0,0 @@
<?php
use Phinx\Migration\AbstractMigration;
class RemoveTableWehookQuerie extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* addCustomColumn
* renameColumn
* addIndex
* addForeignKey
*
* Any other destructive changes will result in an error when trying to
* rollback the migration.
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$this->table('webhook_querie')->drop()->save();
}
}

View file

@ -1,38 +0,0 @@
<?php
use Phinx\Migration\AbstractMigration;
class AddApiKeyUser extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* addCustomColumn
* renameColumn
* addIndex
* addForeignKey
*
* Any other destructive changes will result in an error when trying to
* rollback the migration.
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$user = $this->table('user');
$user->addColumn('api_key', 'string', ['limit' => 32, 'null' => false]);
$user->update();
}
}

View file

@ -1,38 +0,0 @@
<?php
use Phinx\Migration\AbstractMigration;
class RemoveTransferFromUser extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* addCustomColumn
* renameColumn
* addIndex
* addForeignKey
*
* Any other destructive changes will result in an error when trying to
* rollback the migration.
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$user = $this->table('user');
$user->removeColumn('transfer');
$user->update();
}
}