some fix and file upload

This commit is contained in:
2023-05-24 01:22:03 +03:00
parent 57daa93406
commit a7501fee35
5 changed files with 173 additions and 0 deletions

View File

@ -0,0 +1,35 @@
<?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}}');
}
}