internal/store/migrations/0023_page_domains.up.sql

4d2790c4197f943ef7906c32af388d6b501b93f8
gitbay/internal/store/migrations/0023_page_domains.up.sql

7 lines · 341 bytes

1-- Custom domains for pages: one domain serves one repo's pages branch.
2CREATE TABLE page_domains (
3    domain     TEXT PRIMARY KEY,
4    repo_id    INTEGER NOT NULL REFERENCES repos(id) ON DELETE CASCADE,
5    created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%SZ','now'))
6);
7CREATE INDEX page_domains_repo ON page_domains(repo_id);