feat: db connection and migration

This commit is contained in:
2026-06-10 07:51:00 +00:00
parent 935ff5b757
commit 63714f5960
3 changed files with 58 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
-- ClaudeDo Online Inbox — initial schema.
-- Mirrors the desktop's Idle task backlog. Idempotent.
create table if not exists lists (
id text primary key, -- GUID supplied by the desktop, reused verbatim
name text not null,
updated_at timestamptz not null default now()
);
create table if not exists tasks (
id text primary key, -- GUID; shared id space (web + desktop)
list_id text not null references lists(id) on delete cascade,
title text not null,
description text,
source text not null, -- 'web' | 'desktop'
consumed boolean not null default false, -- web->desktop handoff flag
created_at timestamptz not null default now(),
updated_at timestamptz not null default now()
);
create index if not exists idx_tasks_list_id on tasks(list_id);
create index if not exists idx_tasks_unconsumed on tasks(consumed) where consumed = false;