From c721d9f97fa672676fb3d94e6428f97ee5078361 Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Tue, 20 Sep 2022 13:22:22 +0200 Subject: [PATCH] Add constraint test --- internal/sqlutil/migrate_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/sqlutil/migrate_test.go b/internal/sqlutil/migrate_test.go index a1088a712..5116237a1 100644 --- a/internal/sqlutil/migrate_test.go +++ b/internal/sqlutil/migrate_test.go @@ -130,5 +130,9 @@ func Test_insertMigration(t *testing.T) { if err := sqlutil.InsertMigration(context.Background(), db, "testing"); err != nil { t.Fatalf("unable to insert migration: %s", err) } + // Second insert should not return an error, as it was already executed. + if err := sqlutil.InsertMigration(context.Background(), db, "testing"); err != nil { + t.Fatalf("unable to insert migration: %s", err) + } }) }