Skip to content

Commit 6d592d2

Browse files
Update InteractionsWithTables.cpp
1 parent 83b888c commit 6d592d2

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

DataBase/source/InteractionsWithTables.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,17 @@ CREATE TABLE IF NOT EXISTS Role (
3737
);
3838
3939
-- Таблица связи Person_Role (многие-ко-многим между People и Role)
40-
CREATE TABLE IF NOT EXISTS Person_Role (
41-
person_id INT REFERENCES People(person_id),
42-
role_id INT REFERENCES Role(role_id),
43-
PRIMARY KEY (person_id, role_id) ON DELETE CASCADE
40+
-- CREATE TABLE IF NOT EXISTS Person_Role (
41+
-- person_id INT REFERENCES People(person_id),
42+
-- role_id INT REFERENCES Role(role_id),
43+
-- PRIMARY KEY (person_id, role_id)
44+
--);
45+
46+
CREATE TABLE person_role (
47+
person_id INTEGER NOT NULL,
48+
role_id INTEGER NOT NULL,
49+
PRIMARY KEY (person_id, role_id),
50+
FOREIGN KEY (person_id) REFERENCES people (person_id) ON DELETE CASCADE
4451
);
4552
4653
-- Исправленная таблица Course (была опечатка в названии Cource)

0 commit comments

Comments
 (0)