These primary keys were converted to bigints in migrations, but the
sequences were left unmentioned. If the original migrations are run on
postgresql 10.0+, then this leads to a mismatch in column types vs sequence
types. This migration fixes these mismatches.
If the original migrations were run on postgresql < 10, all sequences were
bigints anyway, and this migration is a no-op.
If the sequence is a bigint, then postgresql doesn't output that fact in the
statement dump.
Refs #4298
--- /dev/null
+class AlterSequencesBigint < ActiveRecord::Migration[7.1]
+ def up
+ safety_assured do
+ execute "ALTER SEQUENCE oauth_nonces_id_seq AS bigint"
+ execute "ALTER SEQUENCE notes_id_seq AS bigint"
+ execute "ALTER SEQUENCE note_comments_id_seq AS bigint"
+ end
+ end
+
+ def down
+ safety_assured do
+ execute "ALTER SEQUENCE oauth_nonces_id_seq AS integer"
+ execute "ALTER SEQUENCE notes_id_seq AS integer"
+ execute "ALTER SEQUENCE note_comments_id_seq AS integer"
+ end
+ end
+end
--
CREATE SEQUENCE public.note_comments_id_seq
--
CREATE SEQUENCE public.note_comments_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
START WITH 1
INCREMENT BY 1
NO MINVALUE
--
CREATE SEQUENCE public.notes_id_seq
--
CREATE SEQUENCE public.notes_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
START WITH 1
INCREMENT BY 1
NO MINVALUE
--
CREATE SEQUENCE public.oauth_nonces_id_seq
--
CREATE SEQUENCE public.oauth_nonces_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
START WITH 1
INCREMENT BY 1
NO MINVALUE
('20231117170422'),
('20231101222146'),
('20231029151516'),
('20231117170422'),
('20231101222146'),
('20231029151516'),