This repository was archived by the owner on Jun 4, 2024. It is now read-only.

Description
When a table has been created with foreign keys, the next generator run will include a migration again that adds the same foreign keys.
Example:
<?php
/**
* Table for Task
*/
class m200803_210003_change_table_tasks extends \yii\db\Migration
{
public function safeUp()
{
$this->addForeignKey('fk_tasks_project_id_projects_id', '{{%tasks}}', 'project_id', '{{%projects}}', 'id');
$this->addForeignKey('fk_tasks_creator_id_users_id', '{{%tasks}}', 'creator_id', '{{%users}}', 'id');
}
public function safeDown()
{
$this->dropForeignKey('fk_tasks_creator_id_users_id', '{{%tasks}}');
$this->dropForeignKey('fk_tasks_project_id_projects_id', '{{%tasks}}');
}
}
@Insolita You should be able to reproduce this in the layer5 project when running ./yii gii/api.