From d6968f0c815300ccf5c8ca688f1ebea7f02d6f47 Mon Sep 17 00:00:00 2001 From: rsakeys <5@rsakeys.org> Date: Tue, 7 Apr 2020 19:36:32 +0100 Subject: [PATCH] Add question_id column in Houdini's database --- houdini.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/houdini.sql b/houdini.sql index dfa1e78..403675b 100644 --- a/houdini.sql +++ b/houdini.sql @@ -1263,6 +1263,7 @@ COMMENT ON COLUMN redemption_book.name IS 'Book name'; DROP TABLE IF EXISTS redemption_book_word; CREATE TABLE redemption_book_word ( + question_id SERIAL, book_id INT NOT NULL, page SMALLINT NOT NULL DEFAULT 1, line SMALLINT NOT NULL DEFAULT 1, @@ -1271,6 +1272,7 @@ CREATE TABLE redemption_book_word ( PRIMARY KEY(book_id, page, line, word_number), CONSTRAINT redemption_book_word_ibfk_1 FOREIGN KEY (book_id) REFERENCES redemption_book (id) ON DELETE CASCADE ON UPDATE CASCADE ); +ALTER SEQUENCE redemption_book_word_question_id_seq RESTART WITH 1; COMMENT ON TABLE redemption_book_word IS 'Redemption book answers';