2023-09-22 19:22:36 +01:00
|
|
|
-- drop table if exists model_data_point;
|
2023-09-21 16:43:11 +01:00
|
|
|
-- drop table if exists model_defenitions;
|
2023-09-21 15:38:02 +01:00
|
|
|
-- drop table if exists models;
|
|
|
|
create table if not exists models (
|
|
|
|
id uuid primary key default gen_random_uuid(),
|
|
|
|
user_id uuid references users (id) not null,
|
|
|
|
name varchar (70) not null,
|
|
|
|
-- Status:
|
|
|
|
-- -1: failed preparing
|
|
|
|
-- 1: preparing
|
|
|
|
status integer default 1,
|
|
|
|
|
|
|
|
width integer,
|
|
|
|
height integer,
|
|
|
|
color_mode varchar (20)
|
|
|
|
);
|
|
|
|
|
2023-09-22 19:22:36 +01:00
|
|
|
-- drop table if exists model_data_point;
|
2023-09-21 16:43:11 +01:00
|
|
|
-- drop table if exists model_classes;
|
|
|
|
create table if not exists model_classes (
|
|
|
|
id uuid primary key default gen_random_uuid(),
|
2023-09-22 19:22:36 +01:00
|
|
|
model_id uuid references models (id) on delete cascade,
|
2023-09-21 16:43:11 +01:00
|
|
|
name varchar (70) not null
|
|
|
|
);
|
2023-09-22 19:22:36 +01:00
|
|
|
|
|
|
|
-- drop table if exists model_data_point;
|
|
|
|
create table if not exists model_data_point (
|
|
|
|
id uuid primary key default gen_random_uuid(),
|
|
|
|
class_id uuid references model_classes (id) on delete cascade,
|
|
|
|
file_path text not null,
|
|
|
|
-- 1 training
|
|
|
|
-- 2 testing
|
|
|
|
model_mode integer default 1
|
|
|
|
);
|