@jpgilldev / steid

steid/migrations/20260804093030_create_orgs.sql
525 BRaw
1-- Organisations own everything. Every user gets a personal one, whose name is their
2-- public handle and the {owner} segment of every URL.
3--
4-- `name` is unique and case-insensitive: OrgName lowercases on the way in, and nocase
5-- stops a differently-cased duplicate slipping past that. This constraint is also what
6-- actually serialises two simultaneous claims of an unclaimed instance.
7create table orgs (
8 id text primary key,
9 name text not null unique collate nocase,
10 display_name text
11);