Skip to content

Commit

Permalink
Add tests for inferred ALTER SCHEMA migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-farries committed Jun 24, 2024
1 parent e7c5ac6 commit 6480058
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/state/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ func TestInferredMigration(t *testing.T) {
name: "create/drop schema",
sqlStmts: []string{
"CREATE SCHEMA foo",
"DROP SCHEMA foo",
"ALTER SCHEMA foo RENAME TO bar",
"DROP SCHEMA bar",
},
wantMigrations: []migrations.Migration{
{
Expand All @@ -211,7 +212,12 @@ func TestInferredMigration(t *testing.T) {
},
{
Operations: migrations.Operations{
&migrations.OpRawSQL{Up: "DROP SCHEMA foo"},
&migrations.OpRawSQL{Up: "ALTER SCHEMA foo RENAME TO bar"},
},
},
{
Operations: migrations.Operations{
&migrations.OpRawSQL{Up: "DROP SCHEMA bar"},
},
},
},
Expand Down

0 comments on commit 6480058

Please sign in to comment.