46 lines
814 B
PHP
46 lines
814 B
PHP
<?php
|
|
|
|
use yii\db\mysql\Schema;
|
|
use yii\db\Migration;
|
|
|
|
/**
|
|
* Class m240819_084542_parameters
|
|
*/
|
|
class m240819_084542_parameters extends Migration
|
|
{
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function safeUp()
|
|
{
|
|
$this->createTable('parameters', [
|
|
'id' => Schema::TYPE_PK,
|
|
'title' => Schema::TYPE_STRING . ' NOT NULL',
|
|
'type' => 'TINYINT NOT NULL CHECK (type IN (1, 2))',
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function safeDown()
|
|
{
|
|
$this->dropTable('parameters');
|
|
}
|
|
|
|
/*
|
|
// Use up()/down() to run migration code without a transaction.
|
|
public function up()
|
|
{
|
|
|
|
}
|
|
|
|
public function down()
|
|
{
|
|
echo "m240819_084542_parameters cannot be reverted.\n";
|
|
|
|
return false;
|
|
}
|
|
*/
|
|
}
|