-
Notifications
You must be signed in to change notification settings - Fork 116
Closed
Description
Couldn't find how to handle ENUMs in the tutorial docs. How do I make tenant_status in the following schema an ADT in Opaleye?
create type tenant_status as enum('active', 'inactive');
create table tenants(
id serial primary key
,created_at timestamp without time zone not null default current_timestamp
,updated_at timestamp without time zone not null default current_timestamp
,name text not null
,status tenant_status not null default 'inactive'
,owner_id integer
,backoffice_domain text not null
constraint ensure_not_null_owner_id check (tenent_status!='active' or owner_id is not null)
);
Metadata
Metadata
Assignees
Labels
No labels