2024-08-19 11:24:25 +02:00
|
|
|
<?php
|
|
|
|
|
2024-08-20 04:45:28 +02:00
|
|
|
use yii\db\mysql\Schema;
|
2024-08-19 11:24:25 +02:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
}
|