From 72f5d358f5db32aa6593624d8f3da8223e1a3918 Mon Sep 17 00:00:00 2001 From: Brian Haley Date: Tue, 3 Sep 2019 13:55:36 -0400 Subject: [PATCH] Many-to-many table for actions and sourceentry --- schema/actions.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/schema/actions.sql b/schema/actions.sql index d8aa616..53f1d87 100644 --- a/schema/actions.sql +++ b/schema/actions.sql @@ -36,3 +36,13 @@ CREATE TABLE actions_traits ( actions_id INTEGER NOT NULL, traits_id INTEGER NOT NULL ); + +-- Joining table -- +CREATE TABLE actions_sourceentries ( + id INTEGER PRIMARY KEY + ,actions_id INTEGER NOT NULL + ,sourceentry_id INTEGER NOT NULL + ,UNIQUE (id, actions_id, soruceentry_id), + ,FOREIGN KEY (actions_id) REFERENCES actions(actions_id) + ,FOREIGN KEY (sourceentry_id) REFERENCES sourceentry(sourceentry_id) +); \ No newline at end of file