From 202ef602aa8672c74619cd2db47dc3e1bab747a6 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sat, 18 Aug 2012 16:29:03 +0200 Subject: Lafargue: Fix semi-private posting. --- migrations/4_add_user_default_target.sql | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 migrations/4_add_user_default_target.sql (limited to 'migrations') diff --git a/migrations/4_add_user_default_target.sql b/migrations/4_add_user_default_target.sql new file mode 100644 index 0000000..89d0b25 --- /dev/null +++ b/migrations/4_add_user_default_target.sql @@ -0,0 +1,12 @@ +CREATE TABLE user_default_target( + "user" INTEGER NOT NULL, + target INTEGER NOT NULL, + PRIMARY KEY("user", target), + FOREIGN KEY("user") REFERENCES users, + FOREIGN KEY(target) REFERENCES roles +); + +INSERT INTO user_default_target + SELECT users.id, roles.id + FROM users + INNER JOIN roles ON (roles."name" = 'Inner Circle'); -- cgit v1.2.3