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

2f6b4f2de726155c8b805122f50ad7b93bfd827f
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);