2023-05-25 22:45:26 -05:00
|
|
|
create table domains (
|
|
|
|
tenant_id varchar(21) not null
|
|
|
|
references tenants (id) on update cascade on delete cascade,
|
|
|
|
id varchar(21) not null,
|
|
|
|
domain varchar(256) not null,
|
2023-06-07 22:07:15 -05:00
|
|
|
status varchar(32) /* @use DomainStatus */ not null default('PendingVerification'),
|
2023-05-25 22:45:26 -05:00
|
|
|
error_message varchar(1024),
|
|
|
|
dns_records jsonb /* @use DomainDnsRecords */ not null default '[]'::jsonb,
|
|
|
|
cloudflare_data jsonb /* @use CloudflareData */,
|
|
|
|
updated_at timestamptz not null default(now()),
|
|
|
|
created_at timestamptz not null default(now()),
|
|
|
|
primary key (id),
|
|
|
|
constraint domains__domain
|
2023-06-13 21:12:08 -05:00
|
|
|
unique (tenant_id, domain)
|
2023-05-25 22:45:26 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
create index domains__id on domains (tenant_id, id);
|