Foreign key fix

This commit is contained in:
Marcin Kurczewski 2013-11-13 19:54:20 +01:00
parent 202c820a9a
commit 70a4b46cf1

View file

@ -9,7 +9,7 @@ CREATE TABLE post_score
user_id INTEGER, user_id INTEGER,
score INTEGER, score INTEGER,
FOREIGN KEY(post_id) REFERENCES post(id) ON DELETE CASCADE ON UPDATE SET NULL, FOREIGN KEY(post_id) REFERENCES post(id) ON DELETE CASCADE ON UPDATE SET NULL,
FOREIGN KEY(user_id) REFERENCES post(id) ON DELETE CASCADE ON UPDATE SET NULL FOREIGN KEY(user_id) REFERENCES user(id) ON DELETE CASCADE ON UPDATE SET NULL
); );
CREATE INDEX idx_fk_post_score_post_id ON post_score(post_id); CREATE INDEX idx_fk_post_score_post_id ON post_score(post_id);
CREATE INDEX idx_fk_post_score_user_id ON post_score(user_id); CREATE INDEX idx_fk_post_score_user_id ON post_score(user_id);