createTable('{{%cms_menu_frontend}}', [ 'id' => $this->primaryKey(), 'parent_id' => $this->integer()->defaultValue(null), 'name' => $this->string(255)->notNull(), 'link' => $this->string(255)->defaultValue(null), 'position' => $this->string(50)->notNull()->comment('navbar, left_menu'), 'sort_order' => $this->integer()->defaultValue(0), 'status' => $this->smallInteger(1)->defaultValue(1), 'created_at' => $this->integer(), 'updated_at' => $this->integer(), ]); $this->addForeignKey( 'fk-cms_menu_frontend-parent_id', '{{%cms_menu_frontend}}', 'parent_id', '{{%cms_menu_frontend}}', 'id', 'CASCADE' ); } /** * {@inheritdoc} */ public function safeDown() { $this->dropForeignKey('fk-cms_menu_frontend-parent_id', '{{%cms_menu_frontend}}'); $this->dropTable('{{%cms_menu_frontend}}'); } }