Pre-launch — Gluecron is in final validation. Public signups and git hosting for non-owner users open after launch review.
CodeIssuesDiscussionsWikiPull RequestsProjectsCommitsActionsReleasesContributorsPulse● GatesSecuritySettingsDeploymentsPipelineInsightsAgents✨ Explain✨ Ask AI✨ Workspace✨ Spec✨ Tests▓ Debt Map✨ NL Search🏛 Archaeology
Blame · Line-by-line history

0038_deployment_ready_after.sql

Each line is annotated with the commit that last touched it. Click any SHA to jump to that commit and see the surrounding change.

0038_deployment_ready_after.sqlBlame24 lines · 1 contributor
a76d984Claude1-- Deployment wait-timer enforcement (Block C4 follow-up).
2--
3-- Until now `environments.wait_timer_minutes` was stored but never enforced —
4-- approved deploys flipped to status="pending" the moment the last approval
5-- landed. This column unblocks real wait-timer semantics:
6--
7-- ready_after IS NULL → no wait; deploy may run as soon as it is "pending".
8-- ready_after > now() → deploy is "waiting_timer"; autopilot flips it to
9-- "pending" once the timer elapses.
10-- ready_after <= now() → deploy is ready (autopilot or any reader can flip).
11--
12-- Strictly additive — no existing rows touched, default is NULL so legacy
13-- deployments behave exactly as before.
14
15ALTER TABLE "deployments"
16 ADD COLUMN IF NOT EXISTS "ready_after" timestamptz;
17
18--> statement-breakpoint
19
20-- Partial index covers the autopilot sweep query
21-- (status='waiting_timer' AND ready_after <= now()).
22CREATE INDEX IF NOT EXISTS "deployments_ready_after"
23 ON "deployments" ("ready_after")
24 WHERE "ready_after" IS NOT NULL;