guild/console/migrations/m230523_205626_create_file_table.php

36 lines
800 B
PHP
Raw Normal View History

2023-05-24 01:22:03 +03:00
<?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}}');
}
}