Files
archived-orca/cloud/apps/sandbox-control/migrations/0006_lifecycle_w2.sql
T
Neil c250505f75 feat(cloud): wake (single-flight, long-poll), restart, status metrics, archive/unarchive on the sandbox control plane
# Conflicts:
#	cloud/apps/sandbox-control/src/index.ts

# Conflicts:
#	cloud/apps/sandbox-control/src/env.ts
#	cloud/apps/sandbox-control/src/index.ts
#	cloud/apps/sandbox-control/test/fake-vercel.ts
2026-11-09 05:02:20 -08:00

19 lines
1.0 KiB
SQL

-- Workspace lifecycle (wake, status, archive).
-- orcad's public wss endpoint for the current session (not a secret: pairing still needs the code),
-- and when orcad last became ready, so wake callers can report `readyAt` without a provider call.
ALTER TABLE sandboxes ADD COLUMN orcad_endpoint TEXT;
ALTER TABLE sandboxes ADD COLUMN ready_at INTEGER;
-- Archive = stopped with the snapshot kept for a finite TTL; the cron destroys it after archive_expires_at.
-- (`archived_at` itself comes from 0020_api_routines.sql, already applied on dev.)
ALTER TABLE sandboxes ADD COLUMN archive_expires_at INTEGER;
-- What an archived workspace shows without waking: branch, last commits, changed files, file tree, PRs.
-- Captured in the VM at archive (or sent by the desktop from its cache when the VM was already asleep).
-- Bounded (see archive.ts); deleted with the sandbox.
CREATE TABLE sandbox_archives (
sandbox_id TEXT PRIMARY KEY REFERENCES sandboxes (id),
captured_at INTEGER NOT NULL,
source TEXT NOT NULL,
metadata TEXT NOT NULL
);