write migrations for documents
This commit is contained in:
30
console/migrations/m211223_090918_create_template_table.php
Normal file
30
console/migrations/m211223_090918_create_template_table.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `{{%template}}`.
|
||||
*/
|
||||
class m211223_090918_create_template_table extends Migration
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeUp()
|
||||
{
|
||||
$this->createTable('{{%template}}', [
|
||||
'id' => $this->primaryKey(),
|
||||
'title' => $this->string(),
|
||||
'created_at' => $this->dateTime(),
|
||||
'updated_at' => $this->dateTime()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeDown()
|
||||
{
|
||||
$this->dropTable('{{%template}}');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user