createTable('project_lang', [ 'project_id' => $this->integer() ->notNull(), 'language_id' => $this->integer() ->notNull(), 'title' => $this->string() ->notNull(), 'description' => $this->text(), ]); $this->createIndex('project_lang_project_language_key', 'project_lang', [ 'project_id', 'language_id', ], true); $this->addForeignKey('project_fk', 'project_lang', 'project_id', 'project', 'project_id', 'CASCADE', 'CASCADE'); $this->addForeignKey('language_fk', 'project_lang', 'language_id', 'language', 'language_id', 'RESTRICT', 'CASCADE'); } /** * @inheritdoc */ public function down() { $this->dropTable('project_lang'); } }