[#5618] added support to conditionally reapply migrations

This commit is contained in:
Gani Georgiev
2024-10-08 16:23:58 +03:00
parent ed1dc54f27
commit 646331bfa2
13 changed files with 320 additions and 207 deletions

View File

@@ -42,6 +42,31 @@ func TestHasTable(t *testing.T) {
}
}
func TestAuxHasTable(t *testing.T) {
t.Parallel()
app, _ := tests.NewTestApp()
defer app.Cleanup()
scenarios := []struct {
tableName string
expected bool
}{
{"", false},
{"test", false},
{"_lOGS", true}, // table names are case insensitives by default
}
for _, s := range scenarios {
t.Run(s.tableName, func(t *testing.T) {
result := app.AuxHasTable(s.tableName)
if result != s.expected {
t.Fatalf("Expected %v, got %v", s.expected, result)
}
})
}
}
func TestTableColumns(t *testing.T) {
t.Parallel()