Skip to content

Commit

Permalink
Rename sequences
Browse files Browse the repository at this point in the history
  • Loading branch information
v0idpwn committed Sep 13, 2023
1 parent e9f8d18 commit ebd5892
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sql/pgmq--0.24.0--0.25.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@ BEGIN
LOOP
EXECUTE FORMAT('ALTER TABLE public.pgmq_%s SET SCHEMA pgmq', qname);
EXECUTE FORMAT('ALTER TABLE public.pgmq_%s_archive SET SCHEMA pgmq', qname);
EXECUTE FORMAT('ALTER SEQUENCE pgmq.pgmq_%s_msg_id_seq RENAME TO queue_%s_msg_id_seq', qname, qname);

EXECUTE FORMAT('ALTER TABLE pgmq.pgmq_%s RENAME TO queue_%s', qname, qname);
EXECUTE FORMAT('ALTER TABLE pgmq.pgmq_%s_archive RENAME TO queue_%s_archive', qname, qname);
EXECUTE FORMAT('ALTER SEQUENCE pgmq.pgmq_%s_archive_msg_id_seq RENAME TO queue_%s_archive_msg_id_seq', qname, qname);
END LOOP;
END $$;

Expand Down

0 comments on commit ebd5892

Please sign in to comment.