From 575b84f1919b133d13286b0556394f54b0debc7b Mon Sep 17 00:00:00 2001 From: Mikkel <4072916+Mikk3@users.noreply.github.com> Date: Sat, 4 Jun 2022 09:57:27 +0200 Subject: [PATCH] =?UTF-8?q?=C3=A6ndre=20tabel=20navn=20users=5Fgroups=20ti?= =?UTF-8?q?l=20users=5Fin=5Fgroups?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aula/schema.sql | 2 +- aula/schema_drop.sql | 2 +- aula/schema_ins.sql | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/aula/schema.sql b/aula/schema.sql index 86fcde2..7da6a6d 100644 --- a/aula/schema.sql +++ b/aula/schema.sql @@ -38,7 +38,7 @@ CREATE TABLE IF NOT EXISTS posts ( ); -- Relationships -CREATE TABLE IF NOT EXISTS users_groups ( +CREATE TABLE IF NOT EXISTS users_in_groups ( cpr_num integer REFERENCES users(cpr_num) NOT NULL, group_id integer REFERENCES groups(group_id) NOT NULL, PRIMARY KEY (cpr_num, group_id) diff --git a/aula/schema_drop.sql b/aula/schema_drop.sql index da3cfb4..7b504bd 100644 --- a/aula/schema_drop.sql +++ b/aula/schema_drop.sql @@ -1,4 +1,4 @@ -DROP TABLE IF EXISTS users_groups; +DROP TABLE IF EXISTS users_in_groups; DROP TABLE IF EXISTS messages; DROP TABLE IF EXISTS threads; DROP TABLE IF EXISTS posts; diff --git a/aula/schema_ins.sql b/aula/schema_ins.sql index 7f170de..8c886eb 100644 --- a/aula/schema_ins.sql +++ b/aula/schema_ins.sql @@ -1,4 +1,4 @@ -TRUNCATE users, groups, threads, messages, posts, users_groups; +TRUNCATE users, groups, threads, messages, posts, users_in_groups; INSERT INTO public.users(cpr_num, first_name, last_name, password, role) VALUES (5000, 'Gordon', 'Freeman', '$2b$12$KFkp1IEMGT4QrWwjPGhE3ejOv6Z3pYhx/S4qOoFbanR2sMiZqgeJO', 'teacher'), @@ -12,7 +12,7 @@ INSERT INTO public.groups(group_id, name, mandatory) VALUES (1000, 'fodbold', TRUE), (1001,'3a', FALSE); -INSERT INTO users_groups (cpr_num, group_id) VALUES (5000, 1000), (5001, 1001); +INSERT INTO users_in_groups (cpr_num, group_id) VALUES (5000, 1000), (5001, 1001); INSERT INTO threads(thread_id ,title, group_id) VALUES (2000, 'Anbefalinger til fodboldsko?', 1000);