create table vkr.student
(
    id                     integer primary key generated by default as identity,
    form                   boolean,
    protection_order       integer not null,
    magistracy             text,
    digital_format_present boolean,
    mark_comment           integer,
    mark_practice          integer,
    predefence_comment     text,
    normal_control         text,
    anti_plagiarism        int,
    note                   text,
    record_book_returned   boolean,
    work                   text,
    user_id                integer not null,
    diploma_topic_id       integer not null,
    mentor_user_id         integer not null,
    group_id               integer not null,
    foreign key (user_id) references vkr.user (id) on delete cascade,
    foreign key (diploma_topic_id) references vkr.diploma_topic (id) on delete cascade,
    foreign key (mentor_user_id) references vkr.user (id) on delete cascade,
    foreign key (group_id) references vkr.group (id) on delete cascade
)
