17 lines
848 B
SQL
17 lines
848 B
SQL
-- Schema for the SDE meeting toolkit.
|
|
--
|
|
-- Design note: each tool (workshop, scope-lock) stores its data as a single
|
|
-- named "workspace" whose state is a JSON document. A version counter gives us
|
|
-- optimistic concurrency: a save only succeeds if nobody else saved since you
|
|
-- loaded, so two people in the same workspace can't silently clobber each other.
|
|
|
|
CREATE TABLE IF NOT EXISTS workspaces (
|
|
tool TEXT NOT NULL, -- 'workshop' | 'scope-lock'
|
|
name TEXT NOT NULL, -- workspace name, e.g. 'default'
|
|
state JSONB NOT NULL, -- the whole tool state
|
|
version INTEGER NOT NULL DEFAULT 1,
|
|
updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
|
updated_by TEXT, -- optional display name of last editor
|
|
PRIMARY KEY (tool, name)
|
|
);
|