-
Notifications
You must be signed in to change notification settings - Fork 10
/
schema.sql
49 lines (46 loc) · 2.15 KB
/
schema.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
create table if not exists assets
(
id integer primary key autoincrement,
created_at timestamp with time zone default current_timestamp not null,
external_user_id text not null,
external_id text not null,
external_chat_id text not null,
storage_path text not null
);
create table if not exists chat_messages
(
id integer primary key autoincrement,
created_at timestamp with time zone default current_timestamp not null,
text text not null,
external_id text not null,
external_user_id text,
external_chat_id text,
external_image_id text,
external_audio_id text,
external_voice_id text,
external_video_id text,
is_forward boolean default false
);
create table if not exists jobs
(
id integer primary key autoincrement,
created_at timestamp with time zone default current_timestamp not null,
status text default 'created' not null,
params jsonb not null,
chat_session_id integer not null references chat_sessions,
external_id text,
outputs jsonb,
public boolean default false not null,
nsfw boolean default false not null,
deleted_at timestamp with time zone,
external_status text
);
create table if not exists chat_sessions
(
id integer primary key autoincrement,
created_at timestamp with time zone default current_timestamp not null,
logged_in_at timestamp with time zone,
external_user_id text unique,
context jsonb default '{}',
preferences jsonb default '{}'
);