flagon-io/g1t

public

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

g1t/services/deployments/migrations/0004_redirects.sql

15 lines652 bytesCodeBlame
1-- An app's old address after its workspace was renamed: the old script
2-- stays in the dispatch namespace as a Worker that redirects to the app's
3-- new address, for as long as the workspace holds its old slug. The sweep
4-- leaves these scripts alone until `expires_at`, then removes them.
5CREATE TABLE redirects (
6 -- The old script, which is the old hostname's first label on g1t.page.
7 script TEXT PRIMARY KEY,
8 -- The hostname it redirects to.
9 target TEXT NOT NULL,
10 -- The workspace's slug now.
11 workspace TEXT NOT NULL,
12 created_at TEXT NOT NULL,
13 expires_at TEXT NOT NULL
14);
15CREATE INDEX redirects_by_expiry ON redirects (expires_at);