Add question_id column in Houdini's database

This commit is contained in:
rsakeys 2020-04-07 19:36:32 +01:00
parent ce51983a9b
commit d6968f0c81

View File

@ -1263,6 +1263,7 @@ COMMENT ON COLUMN redemption_book.name IS 'Book name';
DROP TABLE IF EXISTS redemption_book_word; DROP TABLE IF EXISTS redemption_book_word;
CREATE TABLE redemption_book_word ( CREATE TABLE redemption_book_word (
question_id SERIAL,
book_id INT NOT NULL, book_id INT NOT NULL,
page SMALLINT NOT NULL DEFAULT 1, page SMALLINT NOT NULL DEFAULT 1,
line 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), 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 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'; COMMENT ON TABLE redemption_book_word IS 'Redemption book answers';