Skip to content

Commit 6688cb6

Browse files
committed
Add live lot memory schema
1 parent 260422c commit 6688cb6

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
create table if not exists lot_events (
2+
id uuid primary key default gen_random_uuid(),
3+
reception_id uuid not null references receptions(id) on delete cascade,
4+
event_type text not null check (event_type in ('quality','production','note')),
5+
title text not null,
6+
detail text,
7+
metrics jsonb not null default '{}'::jsonb,
8+
created_by text not null,
9+
occurred_at timestamptz not null default now(),
10+
created_at timestamptz not null default now()
11+
);
12+
create index if not exists lot_events_reception_time_idx on lot_events(reception_id,occurred_at desc);

0 commit comments

Comments
 (0)