Skip to content

Commit

Permalink
update test for cockroach
Browse files Browse the repository at this point in the history
  • Loading branch information
aqrln committed Nov 28, 2024
1 parent 9c55967 commit 1081887
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion schema-engine/sql-migration-tests/tests/migrations/diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ fn from_unique_index_to_pk(mut api: TestApi) {
],
]
"#]]
} else if api.is_postgres() || api.is_cockroach() {
} else if api.is_postgres() && !api.is_cockroach() {
expect![[r#"
[
[
Expand All @@ -214,6 +214,29 @@ fn from_unique_index_to_pk(mut api: TestApi) {
],
]
"#]]
} else if api.is_cockroach() {
expect![[r#"
[
[
"-- DropIndex",
"DROP INDEX \"C_secondary_key\";",
"",
"-- AlterTable",
"ALTER TABLE \"A\" DROP COLUMN \"name\";",
"ALTER TABLE \"A\" ADD CONSTRAINT \"A_pkey\" PRIMARY KEY (\"id\");",
"",
"-- DropIndex",
"DROP INDEX \"A_id_key\";",
"",
"-- AlterTable",
"ALTER TABLE \"B\" ADD CONSTRAINT \"B_pkey\" PRIMARY KEY (\"x\", \"y\");",
"",
"-- DropIndex",
"DROP INDEX \"B_x_y_key\";",
"",
],
]
"#]]
} else if api.is_mssql() {
expect![[r#"
[
Expand Down

0 comments on commit 1081887

Please sign in to comment.