createTable( 'stock_lang', [ 'stock_id' => $this->integer() ->notNull(), 'language_id' => $this->integer() ->notNull(), 'title' => $this->string() ->notNull(), ] ); $this->createIndex( 'stock_lang_stock_language_key', 'stock_lang', [ 'stock_id', 'language_id', ], true ); $this->addForeignKey('stock_fk', 'stock_lang', 'stock_id', 'stock', 'id', 'CASCADE', 'CASCADE'); $this->addForeignKey('language_fk', 'stock_lang', 'language_id', 'language', 'id', 'RESTRICT', 'CASCADE'); } /** * @inheritdoc */ public function down() { $this->dropTable('stock_lang'); } }