feat(workbench): add runtime GIS and sample integrations

This commit is contained in:
2026-09-22 10:44:31 +08:00
parent a3b4e75317
commit 7ab9b36a5e
62 changed files with 6685 additions and 51 deletions
@@ -0,0 +1,28 @@
-- Read-only work-order projection synchronized by an external work-order source.
BEGIN;
CREATE SCHEMA IF NOT EXISTS workbench;
CREATE TABLE IF NOT EXISTS workbench.work_orders (
project_id uuid NOT NULL,
work_order_id text NOT NULL CHECK (length(work_order_id) > 0),
scheduled_at timestamptz NOT NULL,
updated_at timestamptz NOT NULL,
document jsonb NOT NULL,
PRIMARY KEY (project_id, work_order_id),
CHECK ((jsonb_typeof(document) = 'object'
AND document->>'id' = work_order_id
AND (document->>'scheduled_at')::timestamptz = scheduled_at
AND (document->>'updated_at')::timestamptz = updated_at) IS TRUE)
);
CREATE INDEX IF NOT EXISTS work_orders_project_schedule_idx
ON workbench.work_orders(project_id, scheduled_at, work_order_id);
CREATE INDEX IF NOT EXISTS work_orders_project_updated_idx
ON workbench.work_orders(project_id, updated_at DESC, work_order_id);
REVOKE ALL ON workbench.work_orders FROM PUBLIC;
COMMIT;