2023-05-12 02:12:43 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use yii\db\Migration;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Handles the creation of table `{{%comment}}`.
|
|
|
|
*/
|
|
|
|
class m230511_205501_create_comment_table extends Migration
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
public function safeUp()
|
|
|
|
{
|
|
|
|
$this->createTable('{{%comment}}', [
|
|
|
|
'id' => $this->primaryKey(),
|
|
|
|
'created_at' => $this->dateTime(),
|
|
|
|
'updated_at' => $this->dateTime(),
|
|
|
|
'user_id' => $this->integer(11),
|
|
|
|
'parent_id' => $this->integer(11),
|
|
|
|
'entity_type' => $this->integer(2),
|
|
|
|
'entity_id' => $this->integer(11),
|
2023-05-17 01:14:54 +03:00
|
|
|
'status' => $this->integer(1)->defaultValue(1),
|
2023-05-12 02:12:43 +03:00
|
|
|
'text' => $this->text()
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
public function safeDown()
|
|
|
|
{
|
|
|
|
$this->dropTable('{{%comment}}');
|
|
|
|
}
|
|
|
|
}
|