36 lines
800 B
PHP
36 lines
800 B
PHP
|
<?php
|
||
|
|
||
|
use yii\db\Migration;
|
||
|
|
||
|
/**
|
||
|
* Handles the creation of table `{{%file}}`.
|
||
|
*/
|
||
|
class m230523_205626_create_file_table extends Migration
|
||
|
{
|
||
|
/**
|
||
|
* {@inheritdoc}
|
||
|
*/
|
||
|
public function safeUp()
|
||
|
{
|
||
|
$this->createTable('{{%file}}', [
|
||
|
'id' => $this->primaryKey(),
|
||
|
'name' => $this->string(255),
|
||
|
'path' => $this->text(),
|
||
|
'url' => $this->string(255),
|
||
|
'type' => $this->string(255),
|
||
|
'mime-type' => $this->string(255),
|
||
|
'created_at' => $this->dateTime(),
|
||
|
'updated_at' => $this->dateTime(),
|
||
|
'status' => $this->integer()->defaultValue(1),
|
||
|
]);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* {@inheritdoc}
|
||
|
*/
|
||
|
public function safeDown()
|
||
|
{
|
||
|
$this->dropTable('{{%file}}');
|
||
|
}
|
||
|
}
|