From 845ead316cd08603dc9c53815763a5bfa3cc6e11 Mon Sep 17 00:00:00 2001 From: Andrew Farries Date: Thu, 18 Jan 2024 15:34:23 +0000 Subject: [PATCH] Update test expectations Update test expectations now that FK constraints on duplicated columns have a special prefix. --- pkg/migrations/op_change_type_test.go | 2 +- pkg/migrations/op_set_check_test.go | 2 +- pkg/migrations/op_set_fk_test.go | 4 ++-- pkg/migrations/op_set_notnull_test.go | 2 +- pkg/migrations/op_set_unique_test.go | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/migrations/op_change_type_test.go b/pkg/migrations/op_change_type_test.go index 3b51aa3f..4e6baf7c 100644 --- a/pkg/migrations/op_change_type_test.go +++ b/pkg/migrations/op_change_type_test.go @@ -213,7 +213,7 @@ func TestChangeColumnType(t *testing.T) { }, afterStart: func(t *testing.T, db *sql.DB) { // A temporary FK constraint has been created on the temporary column - ValidatedForeignKeyMustExist(t, db, "public", "employees", migrations.TemporaryName("fk_employee_department")) + ValidatedForeignKeyMustExist(t, db, "public", "employees", migrations.DuplicationName("fk_employee_department")) }, afterRollback: func(t *testing.T, db *sql.DB) { }, diff --git a/pkg/migrations/op_set_check_test.go b/pkg/migrations/op_set_check_test.go index 777e781d..7bf4b724 100644 --- a/pkg/migrations/op_set_check_test.go +++ b/pkg/migrations/op_set_check_test.go @@ -285,7 +285,7 @@ func TestSetCheckConstraint(t *testing.T) { }, afterStart: func(t *testing.T, db *sql.DB) { // A temporary FK constraint has been created on the temporary column - ValidatedForeignKeyMustExist(t, db, "public", "employees", migrations.TemporaryName("fk_employee_department")) + ValidatedForeignKeyMustExist(t, db, "public", "employees", migrations.DuplicationName("fk_employee_department")) }, afterRollback: func(t *testing.T, db *sql.DB) { }, diff --git a/pkg/migrations/op_set_fk_test.go b/pkg/migrations/op_set_fk_test.go index 73db8cf5..709a4daa 100644 --- a/pkg/migrations/op_set_fk_test.go +++ b/pkg/migrations/op_set_fk_test.go @@ -77,7 +77,7 @@ func TestSetForeignKey(t *testing.T) { ColumnMustExist(t, db, "public", "posts", migrations.TemporaryName("user_id")) // A temporary FK constraint has been created on the temporary column - NotValidatedForeignKeyMustExist(t, db, "public", "posts", migrations.TemporaryName("fk_users_id")) + NotValidatedForeignKeyMustExist(t, db, "public", "posts", "fk_users_id") // Inserting some data into the `users` table works. MustInsert(t, db, "public", "02_add_fk_constraint", "users", map[string]string{ @@ -348,7 +348,7 @@ func TestSetForeignKey(t *testing.T) { }, afterStart: func(t *testing.T, db *sql.DB) { // A temporary FK constraint has been created on the temporary column - ValidatedForeignKeyMustExist(t, db, "public", "posts", migrations.TemporaryName("fk_users_id_1")) + ValidatedForeignKeyMustExist(t, db, "public", "posts", migrations.DuplicationName("fk_users_id_1")) }, afterRollback: func(t *testing.T, db *sql.DB) { }, diff --git a/pkg/migrations/op_set_notnull_test.go b/pkg/migrations/op_set_notnull_test.go index 82ed0514..d619386c 100644 --- a/pkg/migrations/op_set_notnull_test.go +++ b/pkg/migrations/op_set_notnull_test.go @@ -291,7 +291,7 @@ func TestSetNotNull(t *testing.T) { }, afterStart: func(t *testing.T, db *sql.DB) { // A temporary FK constraint has been created on the temporary column - ValidatedForeignKeyMustExist(t, db, "public", "employees", migrations.TemporaryName("fk_employee_department")) + ValidatedForeignKeyMustExist(t, db, "public", "employees", migrations.DuplicationName("fk_employee_department")) }, afterRollback: func(t *testing.T, db *sql.DB) { }, diff --git a/pkg/migrations/op_set_unique_test.go b/pkg/migrations/op_set_unique_test.go index 459ed934..aca893db 100644 --- a/pkg/migrations/op_set_unique_test.go +++ b/pkg/migrations/op_set_unique_test.go @@ -330,7 +330,7 @@ func TestSetColumnUnique(t *testing.T) { }, afterStart: func(t *testing.T, db *sql.DB) { // A temporary FK constraint has been created on the temporary column - ValidatedForeignKeyMustExist(t, db, "public", "employees", migrations.TemporaryName("fk_employee_department")) + ValidatedForeignKeyMustExist(t, db, "public", "employees", migrations.DuplicationName("fk_employee_department")) }, afterRollback: func(t *testing.T, db *sql.DB) { },