first commit
This commit is contained in:
@@ -4,7 +4,11 @@ drop table system;
|
||||
drop table oidc;
|
||||
drop table users;
|
||||
drop table user_addresses;
|
||||
drop table teams;
|
||||
drop table user_teams;
|
||||
drop table channels;
|
||||
drop table tools;
|
||||
drop table tasks;
|
||||
drop table history;
|
||||
drop table files;
|
||||
drop table share;
|
||||
|
||||
@@ -1,36 +1,46 @@
|
||||
create table providers (
|
||||
id text not null primary key,
|
||||
name text,
|
||||
team_id text not null,
|
||||
name text not null,
|
||||
key text,
|
||||
url text,
|
||||
_version text
|
||||
_date_created numeric not null default current_timestamp,
|
||||
_date_updated numeric,
|
||||
_version text not null
|
||||
);
|
||||
|
||||
create table models (
|
||||
id text not null primary key,
|
||||
provider_id text,
|
||||
name text,
|
||||
modelname text,
|
||||
configuration text,
|
||||
_version text
|
||||
team_id text not null,
|
||||
provider_id text not null,
|
||||
name text not null default '',
|
||||
modelname text not null default '',
|
||||
configuration text not null default '{}',
|
||||
_date_created numeric not null default current_timestamp,
|
||||
_date_updated numeric,
|
||||
_version text not null
|
||||
);
|
||||
|
||||
create table settings (
|
||||
chat_model_id text,
|
||||
default_lang text,
|
||||
register_enabled numeric,
|
||||
password_enabled numeric,
|
||||
_version text
|
||||
id text not null primary key,
|
||||
default_lang text not null default 'en',
|
||||
register_enabled numeric not null default 1,
|
||||
password_enabled numeric not null default 1,
|
||||
_date_created numeric not null default current_timestamp,
|
||||
_date_updated numeric,
|
||||
_version text not null
|
||||
);
|
||||
|
||||
create table oidc (
|
||||
id text not null primary key,
|
||||
label text,
|
||||
domain text,
|
||||
client_id text,
|
||||
client_secret text,
|
||||
wellknown_url text,
|
||||
_version text
|
||||
label text not null,
|
||||
domain text not null,
|
||||
client_id text not null,
|
||||
client_secret text not null,
|
||||
wellknown_url text not null,
|
||||
_date_created numeric not null default current_timestamp,
|
||||
_date_updated numeric,
|
||||
_version text not null
|
||||
);
|
||||
|
||||
create table users (
|
||||
@@ -41,55 +51,112 @@ create table users (
|
||||
email text not null unique,
|
||||
picture text not null default '',
|
||||
enabled numeric default true,
|
||||
administrator numeric default false,
|
||||
theme text default 'auto',
|
||||
lang text default 'en',
|
||||
_date_created numeric not null default current_timestamp,
|
||||
_date_updated numeric,
|
||||
_version text not null
|
||||
);
|
||||
|
||||
create table user_addresses (
|
||||
id text not null primary key,
|
||||
user_id text,
|
||||
type text,
|
||||
address text,
|
||||
_version text
|
||||
user_id text not null,
|
||||
type text not null,
|
||||
address text not null,
|
||||
_date_created numeric not null default current_timestamp,
|
||||
_date_updated numeric,
|
||||
_version text not null
|
||||
);
|
||||
|
||||
create table teams (
|
||||
id text not null primary key,
|
||||
label text not null,
|
||||
default_model_id text,
|
||||
_date_created numeric not null default current_timestamp,
|
||||
_date_updated numeric ,
|
||||
_version text not null
|
||||
);
|
||||
|
||||
create table user_teams (
|
||||
id text not null primary key,
|
||||
user_id text not null,
|
||||
team_id text not null,
|
||||
administrator bool default 0,
|
||||
_date_created numeric not null default current_timestamp,
|
||||
_date_updated numeric,
|
||||
_version text not null
|
||||
);
|
||||
|
||||
create table channels (
|
||||
id text not null primary key,
|
||||
name text,
|
||||
type text,
|
||||
enabled numeric,
|
||||
configuration text,
|
||||
_version text
|
||||
team_id text not null,
|
||||
name text not null,
|
||||
type text not null,
|
||||
enabled numeric not null default 1,
|
||||
configuration text not null default '{}',
|
||||
_date_created numeric not null default current_timestamp,
|
||||
_date_updated numeric,
|
||||
_version text not null
|
||||
);
|
||||
|
||||
create table tools (
|
||||
id text not null primary key,
|
||||
name text,
|
||||
type text,
|
||||
enabled numeric,
|
||||
configuration text,
|
||||
_version text
|
||||
team_id text not null,
|
||||
name text not null,
|
||||
type text not null,
|
||||
enabled numeric not null default 1,
|
||||
configuration text not null default '{}',
|
||||
_date_created numeric not null default current_timestamp,
|
||||
_date_updated numeric,
|
||||
_version text not null
|
||||
);
|
||||
|
||||
create table tasks (
|
||||
id text not null primary key,
|
||||
owner_id text,
|
||||
model_id text,
|
||||
label text,
|
||||
prompt text,
|
||||
cron text,
|
||||
status text,
|
||||
team_id text not null,
|
||||
model_id text not null,
|
||||
label text not null,
|
||||
prompt text not null,
|
||||
cron text not null,
|
||||
status text not null,
|
||||
next_datetime numeric,
|
||||
_version text
|
||||
_date_created numeric not null default current_timestamp,
|
||||
_date_updated numeric,
|
||||
_version text not null
|
||||
);
|
||||
|
||||
create table history (
|
||||
id text not null primary key,
|
||||
task_id text,
|
||||
start_datetimle numeric,
|
||||
task_id text not null,
|
||||
start_datetime numeric,
|
||||
end_datetime numeric,
|
||||
prompt text,
|
||||
log text,
|
||||
response text,
|
||||
_version text
|
||||
prompt text not null,
|
||||
log text not null,
|
||||
response text not null,
|
||||
_date_created numeric not null default current_timestamp,
|
||||
_date_updated numeric,
|
||||
_version text not null
|
||||
);
|
||||
|
||||
create table files (
|
||||
id text not null primary key,
|
||||
name text not null default '',
|
||||
content_type text not null default '',
|
||||
storage_path text not null default '',
|
||||
storage_filename text not null default '',
|
||||
content blob,
|
||||
_date_created numeric not null default current_timestamp,
|
||||
_date_updated numeric ,
|
||||
_version text not null
|
||||
);
|
||||
|
||||
create table share (
|
||||
id text not null primary key,
|
||||
object_id text not null,
|
||||
object_type text not null,
|
||||
team_id text not null,
|
||||
enabled numeric not null default 0,
|
||||
_date_created numeric not null default current_timestamp,
|
||||
_date_updated numeric,
|
||||
_version text not null
|
||||
);
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
insert into settings (default_lang, register_enabled, password_enabled, _version)
|
||||
values ('en', true, true, 'init');
|
||||
insert into settings (id, default_lang, register_enabled, password_enabled, _version)
|
||||
values ('settings', 'en', true, true, 'init');
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
drop table files;
|
||||
@@ -1,11 +0,0 @@
|
||||
create table files (
|
||||
id text not null primary key,
|
||||
name text not null default '',
|
||||
content_type text not null default '',
|
||||
storage_path text not null default '',
|
||||
storage_filename text not null default '',
|
||||
date_created numeric not null default current_timestamp,
|
||||
date_updated numeric not null default 0,
|
||||
content blob,
|
||||
_version text not null
|
||||
);
|
||||
Reference in New Issue
Block a user