From 70a4b46cf1188e5d75369e2f75eb79c68a846311 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Wed, 13 Nov 2013 19:54:20 +0100 Subject: [PATCH] Foreign key fix --- src/Upgrades/Upgrade4.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Upgrades/Upgrade4.sql b/src/Upgrades/Upgrade4.sql index 6d1474d8..b75cf69c 100644 --- a/src/Upgrades/Upgrade4.sql +++ b/src/Upgrades/Upgrade4.sql @@ -9,7 +9,7 @@ CREATE TABLE post_score user_id INTEGER, score INTEGER, 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_user_id ON post_score(user_id);