fix detach fail, marks
This commit is contained in:
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles adding columns to table `{{%mark}}`.
|
||||
*/
|
||||
class m231004_211051_add_columns_to_mark_table extends Migration
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeUp()
|
||||
{
|
||||
$this->addColumn('mark', 'slug', $this->string(255));
|
||||
$this->addColumn('mark', 'color', $this->string(255));
|
||||
$this->addColumn('mark', 'status', $this->integer(1)->defaultValue(1));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeDown()
|
||||
{
|
||||
$this->dropColumn('mark', 'slug');
|
||||
$this->dropColumn('mark', 'color');
|
||||
$this->dropColumn('mark', 'status');
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `{{%mark_entity}}`.
|
||||
*/
|
||||
class m231004_212828_create_mark_entity_table extends Migration
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeUp()
|
||||
{
|
||||
$this->createTable('{{%mark_entity}}', [
|
||||
'id' => $this->primaryKey(),
|
||||
'mark_id' => $this->integer(11)->notNull(),
|
||||
'entity_type' => $this->integer(1)->notNull(),
|
||||
'entity_id' => $this->integer(11)->notNull(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeDown()
|
||||
{
|
||||
$this->dropTable('{{%mark_entity}}');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user