Created
March 19, 2014 14:06
-
-
Save mretzak/9642321 to your computer and use it in GitHub Desktop.
Check and reset primary key sequence for Big South survey_question_options
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- find highest ID value | |
SELECT MAX(id) FROM survey_question_options; | |
-- check next value in auto-incrementing sequence | |
SELECT nextval('survey_question_options_id_seq'); | |
-- if they are not in sync, reset sequence at highest ID + 1 | |
SELECT setval('survey_question_options_id_seq', (SELECT MAX(id) FROM survey_question_options)+1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment