-- Creating domains\012\012CREATE DOMAIN AUTHORIZATION_ROLE AS VARCHAR(40) CHECK (VALUE IN ('ADMIN', 'POWER_USER', 'USER', 'OBSERVER', 'ETL_SERVER'));\012CREATE DOMAIN BOOLEAN_CHAR AS BOOLEAN DEFAULT FALSE;\012CREATE DOMAIN BOOLEAN_CHAR_OR_UNKNOWN AS CHAR(1) DEFAULT 'U' CHECK (VALUE IN ('F', 'T', 'U'));\012CREATE DOMAIN CODE AS VARCHAR(60);\012CREATE DOMAIN COLUMN_LABEL AS VARCHAR(128);\012CREATE DOMAIN DATA_STORE_SERVICE_KIND AS VARCHAR(40) CHECK (VALUE IN ('PROCESSING', 'QUERIES'));\012CREATE DOMAIN EVENT_TYPE AS VARCHAR(40) CHECK (VALUE IN ('DELETION', 'INVALIDATION', 'MOVEMENT'));\012CREATE DOMAIN FILE AS BYTEA;\012CREATE DOMAIN FILE_NAME AS VARCHAR(100);\012CREATE DOMAIN GENERIC_VALUE AS VARCHAR(1024);\012CREATE DOMAIN OBJECT_NAME AS VARCHAR(50);\012CREATE DOMAIN REAL_VALUE AS REAL;\012CREATE DOMAIN TECH_ID AS BIGINT;\012CREATE DOMAIN TIME_STAMP AS TIMESTAMP WITH TIME ZONE;\012CREATE DOMAIN TIME_STAMP_DFL AS TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP;\012CREATE DOMAIN USER_ID AS VARCHAR(50);\012CREATE DOMAIN TITLE_100 AS VARCHAR(100);\012CREATE DOMAIN GRID_EXPRESSION AS VARCHAR(2000);\012CREATE DOMAIN GRID_ID AS VARCHAR(200);\012CREATE DOMAIN ORDINAL_INT AS BIGINT CHECK (VALUE > 0);\012CREATE DOMAIN DESCRIPTION_2000 AS VARCHAR(2000);\012CREATE DOMAIN ARCHIVING_STATUS AS VARCHAR(100) CHECK (VALUE IN ('LOCKED', 'AVAILABLE', 'ARCHIVED', 'ARCHIVE_PENDING', 'UNARCHIVE_PENDING'));\012CREATE DOMAIN QUERY_TYPE AS VARCHAR(40) CHECK (VALUE IN ('GENERIC', 'EXPERIMENT', 'SAMPLE', 'DATA_SET', 'MATERIAL'));\012