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

4de15d180669ff0f616917f6c0c95e40427efbfa
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);