diff --git a/database/test.go b/database/test.go
index c357c7fe204244566f1af396050f9581c2a7a83a_ZGF0YWJhc2UvdGVzdC5nbw==..89fc90e4005c958af70dd367397d15bb683011fc_ZGF0YWJhc2UvdGVzdC5nbw== 100644
--- a/database/test.go
+++ b/database/test.go
@@ -42,6 +42,16 @@
 	ctx      context.Context
 	tb       testing.TB
 	lockConn *sqlx.Conn
+
+	flags map[string]bool
+}
+
+func (db *TestDB) GetFlag(name string) bool {
+	return db.flags[name]
+}
+
+func (db *TestDB) SetFlag(name string, value bool) {
+	db.flags[name] = value
 }
 
 // SetTB changes the current tb and returns a function to restore the original one
@@ -126,7 +136,7 @@
 
 	success = true
 
-	return &TestDB{db, dsn, ctx, tb, c}
+	return &TestDB{db, dsn, ctx, tb, c, make(map[string]bool)}
 }
 
 // GetTestDB creates a db and returns it. It must be closed within the test.
@@ -192,7 +202,7 @@
 		}
 	}
 
-	testDB := TestDB{db, dsn, ctx, t, c}
+	testDB := TestDB{db, dsn, ctx, t, c, make(map[string]bool)}
 	if len(dbtablenames) == 0 {
 		if err := db.Select(&dbtablenames,
 			"SELECT tablename "+