create table if not exists vna_studies (
    id BIGSERIAL PRIMARY KEY,
    current timestamp default current_timestamp not null,
    user_id integer references user_sonata (id) on delete no action not null,
    comments varchar(1200),
    study_name varchar(300) not null,
    patient_id uuid references patient (id_patient) on delete no action not null
);

create table if not exists vna_files (
    id BIGSERIAL PRIMARY KEY,
    id_study integer references vna_studies (id),
    mime_type varchar(100) not null,
    report boolean default false not null,
    content bytea not null
);