Skip to content

Commit 0b46e54

Browse files
authored
Merge pull request #620 from alphagov/update-petition-ids-for-2017
Update petition id sequences for re-opening
2 parents 80564a6 + 6ad5d23 commit 0b46e54

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class AdjustPetitionSequencesForTwentySeventeen < ActiveRecord::Migration
2+
def up
3+
execute "ALTER SEQUENCE archived_petitions_id_seq MAXVALUE 199999"
4+
execute "ALTER SEQUENCE petitions_id_seq START WITH 200000 RESTART WITH 200000 MINVALUE 200000"
5+
end
6+
7+
def down
8+
execute "ALTER SEQUENCE archived_petitions_id_seq MAXVALUE 99999"
9+
execute "ALTER SEQUENCE petitions_id_seq START WITH 100000 RESTART WITH 100000 MINVALUE 100000"
10+
end
11+
end

db/structure.sql

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ CREATE SEQUENCE archived_petitions_id_seq
276276
START WITH 1
277277
INCREMENT BY 1
278278
NO MINVALUE
279-
MAXVALUE 99999
279+
MAXVALUE 199999
280280
CACHE 1;
281281

282282

@@ -891,9 +891,9 @@ CREATE TABLE petitions (
891891
--
892892

893893
CREATE SEQUENCE petitions_id_seq
894-
START WITH 100000
894+
START WITH 200000
895895
INCREMENT BY 1
896-
MINVALUE 100000
896+
MINVALUE 200000
897897
NO MAXVALUE
898898
CACHE 1;
899899

@@ -2635,5 +2635,7 @@ INSERT INTO schema_migrations (version) VALUES ('20170713193039');
26352635

26362636
INSERT INTO schema_migrations (version) VALUES ('20170818110849');
26372637

2638+
INSERT INTO schema_migrations (version) VALUES ('20170903162156');
2639+
26382640
INSERT INTO schema_migrations (version) VALUES ('20170903181738');
26392641

0 commit comments

Comments
 (0)