Skip to content

Commit

Permalink
Infer CREATE SCHEMA migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-farries committed Jun 17, 2024
1 parent fca5abd commit 7ef79d2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,11 @@ BEGIN
RETURN;
END IF;
SELECT schema_name INTO schemaname FROM pg_catalog.pg_event_trigger_ddl_commands() WHERE schema_name IS NOT NULL;
IF tg_tag != 'CREATE SCHEMA' THEN
SELECT schema_name INTO schemaname FROM pg_catalog.pg_event_trigger_ddl_commands() WHERE schema_name IS NOT NULL;
ELSE
SELECT object_identity INTO schemaname FROM pg_event_trigger_ddl_commands();
END IF;
END IF;
IF schemaname IS NULL THEN
Expand Down

0 comments on commit 7ef79d2

Please sign in to comment.