This repository was archived by the owner on Jun 4, 2024. It is now read-only.
This repository was archived by the owner on Jun 4, 2024. It is now read-only.
Order of migration statement is incorrect when one PK column is deleted and new one is created #152
Open
Description
See file : yii2-openapi/tests/specs/blog_v2/migrations_pgsql_db/m200000_000000_change_table_v2_posts.php
// after deleting uid this should be executed,
// currently getting error about 2 PK in one table
$this->addColumn('{{%v2_posts}}', 'id', $this->bigPrimaryKey());
$this->execute('CREATE TYPE "enum_itt_v2_posts_lang" AS ENUM(\'ru\', \'eng\')');
$this->addColumn('{{%v2_posts}}', 'lang', '"enum_itt_v2_posts_lang" NULL DEFAULT \'ru\'');
// below should be deleted first
$this->dropColumn('{{%v2_posts}}', 'uid');
Order is incorrect. First previous ID should be deleted. Then new one should be created. This result in failing migration.
priority: very low (as ID column once created are not often deleted)
type: enhancemnet
Metadata
Metadata
Assignees
Labels
No labels