Replace individual Rust migration modules with a define_sql_migrations macro that reads up/down SQL files via include_str!. Consolidate all legacy single-file SQL into per-table directories and add full schema migration coverage for 90+ tables.
25 lines
844 B
SQL
25 lines
844 B
SQL
create table if not exists room_ai
|
|
(
|
|
room uuid not null,
|
|
model uuid not null,
|
|
version uuid,
|
|
call_count bigint default 0 not null,
|
|
last_call_at timestamp with time zone,
|
|
history_limit bigint,
|
|
system_prompt text,
|
|
temperature double precision,
|
|
max_tokens bigint,
|
|
use_exact boolean default false not null,
|
|
think boolean default false not null,
|
|
min_score real,
|
|
created_at timestamp with time zone not null,
|
|
updated_at timestamp with time zone not null,
|
|
stream boolean default true not null,
|
|
agent_type varchar(50),
|
|
primary key (room, model)
|
|
);
|
|
|
|
create index if not exists idx_room_ai_agent_type
|
|
on room_ai (agent_type)
|
|
where (agent_type IS NOT NULL);
|