Skip to content

Commit

Permalink
Merge pull request #620 from alphagov/update-petition-ids-for-2017
Browse files Browse the repository at this point in the history
Update petition id sequences for re-opening
  • Loading branch information
pixeltrix authored Sep 9, 2017
2 parents 80564a6 + 6ad5d23 commit 0b46e54
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class AdjustPetitionSequencesForTwentySeventeen < ActiveRecord::Migration
def up
execute "ALTER SEQUENCE archived_petitions_id_seq MAXVALUE 199999"
execute "ALTER SEQUENCE petitions_id_seq START WITH 200000 RESTART WITH 200000 MINVALUE 200000"
end

def down
execute "ALTER SEQUENCE archived_petitions_id_seq MAXVALUE 99999"
execute "ALTER SEQUENCE petitions_id_seq START WITH 100000 RESTART WITH 100000 MINVALUE 100000"
end
end
8 changes: 5 additions & 3 deletions db/structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ CREATE SEQUENCE archived_petitions_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
MAXVALUE 99999
MAXVALUE 199999
CACHE 1;


Expand Down Expand Up @@ -891,9 +891,9 @@ CREATE TABLE petitions (
--

CREATE SEQUENCE petitions_id_seq
START WITH 100000
START WITH 200000
INCREMENT BY 1
MINVALUE 100000
MINVALUE 200000
NO MAXVALUE
CACHE 1;

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

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

INSERT INTO schema_migrations (version) VALUES ('20170903162156');

INSERT INTO schema_migrations (version) VALUES ('20170903181738');

0 comments on commit 0b46e54

Please sign in to comment.