ZIm/crates/collab/migrations_llm.sqlite/20240806182921_test_schema.sql
Marshall Bowers 7f6d0919c9
collab: Setup database for LLM service (#15882)
This PR puts the initial infrastructure for the LLM service's database
in place.

The LLM service will be using a separate Postgres database, with its own
set of migrations.

Currently we only connect to the database in development, as we don't
yet have the database setup for the staging/production environments.

Release Notes:

- N/A
2024-08-06 17:18:08 -04:00

16 lines
521 B
SQL

create table providers (
id integer primary key autoincrement,
name text not null
);
create unique index uix_providers_on_name on providers (name);
create table models (
id integer primary key autoincrement,
provider_id integer not null references providers (id) on delete cascade,
name text not null
);
create unique index uix_models_on_provider_id_name on models (provider_id, name);
create index ix_models_on_provider_id on models (provider_id);
create index ix_models_on_name on models (name);