createTable('{{%task_user}}', [ 'id' => $this->primaryKey(), 'task_id' => $this->integer(), 'project_user_id' => $this->integer(), ]); $this->addForeignKey('task_task_user', 'task_user', 'task_id', 'task', 'id'); $this->addForeignKey('project_user_task_user', 'task_user', 'project_user_id', 'project_user', 'id'); } /** * {@inheritdoc} */ public function safeDown() { $this->dropForeignKey('task_task_user', 'task_user'); $this->dropForeignKey('project_user_task_user', 'task_user'); $this->dropTable('{{%task_user}}'); } }