Unify auth middleware and remove X-User-ID trust, add project_members authorization, sandbox workspaces via resolver, and admin-only reconcile by run_id. Introduce goose migrations with startup schema gate, fail closed when DB unavailable outside explicit ALLOW_IN_MEMORY, bundle web/dist in app Dockerfile, and remove frontend pseudo-login fallback.
13 lines
593 B
SQL
13 lines
593 B
SQL
-- +goose Up
|
|
-- 文档编辑租约(运行时互斥,正交于 is_locked 生命周期锁)
|
|
ALTER TABLE document_records
|
|
ADD COLUMN IF NOT EXISTS lease_holder_type TEXT NOT NULL DEFAULT '',
|
|
ADD COLUMN IF NOT EXISTS lease_holder_id TEXT NOT NULL DEFAULT '',
|
|
ADD COLUMN IF NOT EXISTS lease_work_dir TEXT NOT NULL DEFAULT '',
|
|
ADD COLUMN IF NOT EXISTS lease_expires_at TIMESTAMPTZ,
|
|
ADD COLUMN IF NOT EXISTS lease_heartbeat_at TIMESTAMPTZ;
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_doc_records_lease_expires
|
|
ON document_records (lease_expires_at)
|
|
WHERE lease_holder_type <> '';
|