CREATE TABLE IF NOT EXISTS "role" (
	"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
	"name" text NOT NULL UNIQUE
);
INSERT INTO "role" (name) VALUES ('admin');
INSERT INTO "role" (name) VALUES ('cox');
INSERT INTO "role" (name) VALUES ('scheckbuch');
INSERT INTO "role" (name) VALUES ('tech');

CREATE TABLE IF NOT EXISTS "user_role" (
	"user_id" INTEGER NOT NULL REFERENCES user(id),
	"role_id" INTEGER NOT NULL REFERENCES role(id),
	CONSTRAINT unq UNIQUE (user_id, role_id) 
);

INSERT INTO "user_role" (user_id, role_id) VALUES (11,1); -- Marie Admin
INSERT INTO "user_role" (user_id, role_id) VALUES (40,1); -- PH Admin

-- cox
INSERT INTO "user_role" (user_id, role_id) VALUES (1,2);
INSERT INTO "user_role" (user_id, role_id) VALUES (3,2);
INSERT INTO "user_role" (user_id, role_id) VALUES (11,2);
INSERT INTO "user_role" (user_id, role_id) VALUES (14,2);
INSERT INTO "user_role" (user_id, role_id) VALUES (24,2);
INSERT INTO "user_role" (user_id, role_id) VALUES (33,2);
INSERT INTO "user_role" (user_id, role_id) VALUES (34,2);
INSERT INTO "user_role" (user_id, role_id) VALUES (38,2);
INSERT INTO "user_role" (user_id, role_id) VALUES (39,2);
INSERT INTO "user_role" (user_id, role_id) VALUES (40,2);
INSERT INTO "user_role" (user_id, role_id) VALUES (46,2);
INSERT INTO "user_role" (user_id, role_id) VALUES (48,2);
INSERT INTO "user_role" (user_id, role_id) VALUES (57,2);
INSERT INTO "user_role" (user_id, role_id) VALUES (69,2);
INSERT INTO "user_role" (user_id, role_id) VALUES (70,2);
INSERT INTO "user_role" (user_id, role_id) VALUES (75,2);
INSERT INTO "user_role" (user_id, role_id) VALUES (83,2);
INSERT INTO "user_role" (user_id, role_id) VALUES (86,2);
INSERT INTO "user_role" (user_id, role_id) VALUES (90,2);
INSERT INTO "user_role" (user_id, role_id) VALUES (96,2);
INSERT INTO "user_role" (user_id, role_id) VALUES (105,2);
INSERT INTO "user_role" (user_id, role_id) VALUES (106,2);

-- scheckbuch
INSERT INTO "user_role" (user_id, role_id) VALUES (109,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (112,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (113,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (114,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (115,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (116,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (118,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (119,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (120,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (121,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (122,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (123,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (124,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (126,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (127,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (128,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (129,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (130,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (131,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (132,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (133,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (135,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (136,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (137,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (138,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (139,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (140,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (141,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (142,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (143,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (144,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (145,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (146,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (147,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (153,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (154,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (155,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (159,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (669,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (670,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (671,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (672,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (673,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (674,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (675,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (676,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (677,3);
INSERT INTO "user_role" (user_id, role_id) VALUES (678,3);

-- tech
INSERT INTO "user_role" (user_id, role_id) VALUES (38,4);
INSERT INTO "user_role" (user_id, role_id) VALUES (69,4);
