Написал запрос на создание занятия
This commit is contained in:
@@ -25,3 +25,21 @@ CREATE TABLE IF NOT EXISTS student_groups (
|
||||
name VARCHAR(100) UNIQUE NOT NULL,
|
||||
education_form_id BIGINT NOT NULL REFERENCES education_forms(id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS lessons (
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
teacher_id BIGINT NOT NULL,
|
||||
group_id BIGINT NOT NULL,
|
||||
lesson_id BIGINT NOT NULL,
|
||||
day VARCHAR(255) NOT NULL,
|
||||
week VARCHAR(255) NOT NULL,
|
||||
time VARCHAR(255) NOT NULL
|
||||
);
|
||||
|
||||
ALTER TABLE lessons
|
||||
ADD CONSTRAINT fk_lessons_teacher
|
||||
FOREIGN KEY (teacher_id) REFERENCES users(id);
|
||||
|
||||
ALTER TABLE lessons
|
||||
ADD CONSTRAINT fk_lessons_group
|
||||
FOREIGN KEY (group_id) REFERENCES student_groups(id);
|
||||
Reference in New Issue
Block a user