|
|
@ -12,28 +12,28 @@ class m180830_163050_create_blog_categories_lng_table extends Migration |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function safeUp() |
|
|
|
public function safeUp() |
|
|
|
{ |
|
|
|
{ |
|
|
|
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'; |
|
|
|
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'; |
|
|
|
|
|
|
|
|
|
|
|
$this->createTable('{{%blog_categories_lng}}', [ |
|
|
|
$this->createTable('{{%blog_categories_lng}}', [ |
|
|
|
'id' => $this->primaryKey(), |
|
|
|
'id' => $this->primaryKey(), |
|
|
|
'blog_category_id' => $this->integer()->notNull(), |
|
|
|
'blog_category_id' => $this->integer()->notNull(), |
|
|
|
'language' => $this->string(6)->notNull(), |
|
|
|
'language' => $this->string(6)->notNull(), |
|
|
|
'name' => $this->string()->notNull(), |
|
|
|
'name' => $this->string()->notNull(), |
|
|
|
'title' => $this->string(), |
|
|
|
'title' => $this->string(), |
|
|
|
'description' => $this->text(), |
|
|
|
'description' => $this->text(), |
|
|
|
'meta_title' => $this->string(255), |
|
|
|
'meta_title' => $this->string(255), |
|
|
|
'meta_description' => $this->text(), |
|
|
|
'meta_description' => $this->text(), |
|
|
|
'meta_keywords' => $this->string(255), |
|
|
|
'meta_keywords' => $this->string(255), |
|
|
|
], $tableOptions); |
|
|
|
], $tableOptions); |
|
|
|
|
|
|
|
|
|
|
|
$this->createIndex('idx_blog_categories_lng_language', '{{%blog_categories_lng}}', 'language'); |
|
|
|
$this->createIndex('idx_blog_categories_lng_language', '{{%blog_categories_lng}}', 'language'); |
|
|
|
$this->createIndex('idx_blog_categories_lng_blog_category_id', '{{%blog_categories_lng}}', 'blog_category_id'); |
|
|
|
$this->createIndex('idx_blog_categories_lng_blog_category_id', '{{%blog_categories_lng}}', 'blog_category_id'); |
|
|
|
$this->addForeignKey('frg_blog_categories_lng_blog_categories_blog_category_id_id', '{{%blog_categories_lng}}', 'blog_category_id', '{{%blog_categories}}', 'id', 'CASCADE', 'CASCADE'); |
|
|
|
$this->addForeignKey('frg_blog_categories_lng_blog_categories_blog_category_id_id', '{{%blog_categories_lng}}', 'blog_category_id', '{{%blog_categories}}', 'id', 'CASCADE', 'CASCADE'); |
|
|
|
|
|
|
|
|
|
|
|
$this->dropColumn('{{%blog_categories}}', 'title'); |
|
|
|
$this->dropColumn('{{%blog_categories}}', 'title'); |
|
|
|
$this->dropColumn('{{%blog_categories}}', 'description'); |
|
|
|
$this->dropColumn('{{%blog_categories}}', 'description'); |
|
|
|
$this->dropColumn('{{%blog_categories}}', 'name'); |
|
|
|
$this->dropColumn('{{%blog_categories}}', 'name'); |
|
|
|
$this->dropColumn('{{%blog_categories}}', 'meta_json'); |
|
|
|
$this->dropColumn('{{%blog_categories}}', 'meta_json'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -41,15 +41,15 @@ class m180830_163050_create_blog_categories_lng_table extends Migration |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function safeDown() |
|
|
|
public function safeDown() |
|
|
|
{ |
|
|
|
{ |
|
|
|
$this->dropForeignKey('frg_blog_categories_lng_blog_categories_blog_category_id_id', '{{%blog_categories_lng}}'); |
|
|
|
$this->dropForeignKey('frg_blog_categories_lng_blog_categories_blog_category_id_id', '{{%blog_categories_lng}}'); |
|
|
|
$this->dropIndex('idx_blog_categories_lng_blog_category_id', '{{%blog_categories_lng}}'); |
|
|
|
$this->dropIndex('idx_blog_categories_lng_blog_category_id', '{{%blog_categories_lng}}'); |
|
|
|
$this->dropIndex('idx_blog_categories_lng_language', '{{%blog_categories_lng}}'); |
|
|
|
$this->dropIndex('idx_blog_categories_lng_language', '{{%blog_categories_lng}}'); |
|
|
|
|
|
|
|
|
|
|
|
$this->dropTable('{{%blog_categories_lng}}'); |
|
|
|
$this->dropTable('{{%blog_categories_lng}}'); |
|
|
|
|
|
|
|
|
|
|
|
$this->addColumn('{{%blog_categories}}', 'title', $this->string(255)); |
|
|
|
$this->addColumn('{{%blog_categories}}', 'title', $this->string(255)); |
|
|
|
$this->addColumn('{{%blog_categories}}', 'name', $this->string(255)->notNull()); |
|
|
|
$this->addColumn('{{%blog_categories}}', 'name', $this->string(255)->notNull()); |
|
|
|
$this->addColumn('{{%blog_categories}}', 'description', $this->text()); |
|
|
|
$this->addColumn('{{%blog_categories}}', 'description', $this->text()); |
|
|
|
$this->addColumn('{{%blog_categories}}', 'meta_json', 'LONGTEXT NOT NULL'); |
|
|
|
$this->addColumn('{{%blog_categories}}', 'meta_json', 'LONGTEXT NOT NULL'); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|