42 lines
702 B
PHP
42 lines
702 B
PHP
|
<?php
|
||
|
|
||
|
use yii\db\Migration;
|
||
|
use yii\db\mysql\Schema;
|
||
|
|
||
|
/**
|
||
|
* Class m240820_024046_add_mime_to_image
|
||
|
*/
|
||
|
class m240820_024046_add_mime_to_image extends Migration
|
||
|
{
|
||
|
/**
|
||
|
* {@inheritdoc}
|
||
|
*/
|
||
|
public function safeUp()
|
||
|
{
|
||
|
$this->addColumn('image', 'mime', Schema::TYPE_STRING . ' NOT NULL');
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* {@inheritdoc}
|
||
|
*/
|
||
|
public function safeDown()
|
||
|
{
|
||
|
$this->dropColumn('table', 'mime');
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
// Use up()/down() to run migration code without a transaction.
|
||
|
public function up()
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
public function down()
|
||
|
{
|
||
|
echo "m240820_024046_add_mime_to_image cannot be reverted.\n";
|
||
|
|
||
|
return false;
|
||
|
}
|
||
|
*/
|
||
|
}
|