some fix and file upload
This commit is contained in:
35
console/migrations/m230523_205626_create_file_table.php
Normal file
35
console/migrations/m230523_205626_create_file_table.php
Normal 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}}');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user