2025-07-08 14:37:03 -07:00
|
|
|
create type lens_display_type as enum ('table');
|
|
|
|
|
|
|
|
|
|
create table if not exists lenses (
|
|
|
|
|
id uuid not null primary key,
|
|
|
|
|
name text not null,
|
|
|
|
|
base_id uuid not null references bases(id) on delete cascade,
|
|
|
|
|
class_oid oid not null,
|
2025-08-24 23:24:01 -07:00
|
|
|
filter jsonb not null default 'null'::jsonb,
|
2025-07-08 14:37:03 -07:00
|
|
|
order_by jsonb not null default '[]'::jsonb,
|
|
|
|
|
display_type lens_display_type not null default 'table'
|
|
|
|
|
);
|
|
|
|
|
create index on lenses (base_id);
|
|
|
|
|
|
2025-07-18 16:20:03 -07:00
|
|
|
create table if not exists fields (
|
2025-07-08 14:37:03 -07:00
|
|
|
id uuid not null primary key,
|
|
|
|
|
lens_id uuid not null references lenses(id) on delete cascade,
|
2025-07-18 16:20:03 -07:00
|
|
|
name text not null,
|
2025-07-08 14:37:03 -07:00
|
|
|
label text,
|
2025-09-08 15:56:57 -07:00
|
|
|
presentation jsonb not null,
|
2025-07-08 16:54:51 -07:00
|
|
|
width_px int not null default 200
|
2025-07-08 14:37:03 -07:00
|
|
|
);
|