2024-08-19 14:44:16 +02:00
|
|
|
<?php
|
|
|
|
|
2024-08-20 04:45:28 +02:00
|
|
|
use yii\db\mysql\Schema;
|
2024-08-19 14:44:16 +02:00
|
|
|
use yii\db\Migration;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class m240819_102301_image
|
|
|
|
*/
|
|
|
|
class m240819_102301_image extends Migration
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
public function safeUp()
|
|
|
|
{
|
|
|
|
$this->createTable('image', [
|
|
|
|
'id' => Schema::TYPE_PK,
|
|
|
|
'sha256' => Schema::TYPE_STRING . ' NOT NULL',
|
|
|
|
'original_name' => Schema::TYPE_STRING . ' NOT NULL'
|
|
|
|
]);
|
|
|
|
$this->addColumn('parameters', 'icon', 'INT(11) DEFAULT NULL');
|
|
|
|
$this->addColumn('parameters', 'icon_gray', 'INT(11) DEFAULT NULL');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
public function safeDown()
|
|
|
|
{
|
|
|
|
$this->dropTable('image');
|
|
|
|
$this->dropColumn('parameters', 'icon');
|
|
|
|
$this->dropColumn('parameters', 'icon_gray');
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
// Use up()/down() to run migration code without a transaction.
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
echo "m240819_102301_image cannot be reverted.\n";
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
}
|