Add constraint test

This commit is contained in:
Till Faelligen 2022-09-20 13:22:22 +02:00
parent c9d131d38b
commit c721d9f97f
No known key found for this signature in database
GPG key ID: 3DF82D8AB9211D4E

View file

@ -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)
}
})
}