diff --git a/nakadi-producer-spring-boot-starter/src/main/resources/db_nakadiproducer/migrations/V2/V2133546886.1.4__create_publication.sql b/nakadi-producer-spring-boot-starter/src/main/resources/db_nakadiproducer/migrations/V2/V2133546886.1.4__create_publication.sql index 2a6d9a1..394ba08 100644 --- a/nakadi-producer-spring-boot-starter/src/main/resources/db_nakadiproducer/migrations/V2/V2133546886.1.4__create_publication.sql +++ b/nakadi-producer-spring-boot-starter/src/main/resources/db_nakadiproducer/migrations/V2/V2133546886.1.4__create_publication.sql @@ -1,6 +1,12 @@ -CREATE PUBLICATION nakadi_producer_eventlog - FOR TABLE nakadi_events.event_log; +CREATE PUBLICATION nakadi_producer_fes + FOR TABLE nakadi_events.event_log; -COMMENT ON PUBLICATION nakadi_producer_eventlog - IS 'Publication for collecting event data data via Fabric Event Streams.' - 'If you didn''t set FES up, it won''t be used and do no harm.'; +COMMENT ON PUBLICATION nakadi_producer_fes + IS 'Publication for collecting event data data via Fabric Event Streams.' + 'If you didn''t set FES up, it won''t be used and do no harm.'; + +-- We drop the slot in case it already exists (e.g. created by Patroni from the database manifest), +-- as it needs to be created after the publication. +SELECT pg_drop_replication_slot(slot_name) + FROM pg_replication_slots + WHERE slot_name = 'nakadi_producer_fes';