17 lines
483 B
MySQL
17 lines
483 B
MySQL
|
CREATE TABLE IF NOT EXISTS benutzer_rollen (
|
||
|
benutzer_id UUID NOT NULL,
|
||
|
rolle_id UUID NOT NULL,
|
||
|
|
||
|
CONSTRAINT pk_benutzer_rollen PRIMARY KEY (benutzer_id, rolle_id),
|
||
|
|
||
|
CONSTRAINT fk_benutzer_rollen_benutzer FOREIGN KEY (benutzer_id)
|
||
|
REFERENCES benutzer (id) MATCH SIMPLE
|
||
|
ON UPDATE CASCADE
|
||
|
ON DELETE CASCADE,
|
||
|
|
||
|
CONSTRAINT fk_benutzer_rollen_rolle FOREIGN KEY (rolle_id)
|
||
|
REFERENCES rollen (id) MATCH SIMPLE
|
||
|
ON UPDATE CASCADE
|
||
|
ON DELETE CASCADE
|
||
|
)
|