Skip to content

Person

Description

Entity to store information about individuals as persons. Each person has a unique ID associated with them.

Table Definition
CREATE TABLE "person" (
"person_id" ULID PRIMARY KEY NOT NULL,
"party_id" VARCHAR NOT NULL,
"person_type_id" ULID NOT NULL,
"person_first_name" TEXT NOT NULL,
"person_middle_name" TEXT,
"person_last_name" TEXT NOT NULL,
"previous_name" TEXT,
"honorific_prefix" TEXT,
"honorific_suffix" TEXT,
"gender_id" ULID NOT NULL,
"sex_id" ULID NOT NULL,
"elaboration" TEXT CHECK(json_valid(elaboration) OR elaboration IS NULL),
"created_at" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
"created_by" TEXT DEFAULT 'UNKNOWN',
"updated_at" TIMESTAMPTZ,
"updated_by" TEXT,
"deleted_at" TIMESTAMPTZ,
"deleted_by" TEXT,
"activity_log" TEXT,
FOREIGN KEY("party_id") REFERENCES "party"("party_id"),
FOREIGN KEY("person_type_id") REFERENCES "person_type"("person_type_id"),
FOREIGN KEY("gender_id") REFERENCES "gender_type"("gender_type_id"),
FOREIGN KEY("sex_id") REFERENCES "sex_type"("sex_type_id")
)

Columns

NameTypeDefaultNullableParentsComment
person_idULIDfalse{“isSqlDomainZodDescrMeta”:true,“isUlid”:true}
party_idVARCHARfalseparty{“isSqlDomainZodDescrMeta”:true,“isVarChar”:true}
person_type_idULIDfalseperson_type{“isSqlDomainZodDescrMeta”:true,“isUlid”:true}
person_first_nameTEXTfalse
person_middle_nameTEXTtrue
person_last_nameTEXTfalse
previous_nameTEXTtrue
honorific_prefixTEXTtrue
honorific_suffixTEXTtrue
gender_idULIDfalsegender_type{“isSqlDomainZodDescrMeta”:true,“isUlid”:true}
sex_idULIDfalsesex_type{“isSqlDomainZodDescrMeta”:true,“isUlid”:true}
elaborationTEXTtrue{“isSqlDomainZodDescrMeta”:true,“isJsonText”:true}
created_atTIMESTAMPTZCURRENT_TIMESTAMPtrue
created_byTEXT’UNKNOWN’true
updated_atTIMESTAMPTZtrue
updated_byTEXTtrue
deleted_atTIMESTAMPTZtrue
deleted_byTEXTtrue
activity_logTEXTtrue{“isSqlDomainZodDescrMeta”:true,“isJsonSqlDomain”:true}

Constraints

NameTypeDefinition
person_idPRIMARY KEYPRIMARY KEY (person_id)
- (Foreign key ID: 0)FOREIGN KEYFOREIGN KEY (sex_id) REFERENCES sex_type (sex_type_id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE
- (Foreign key ID: 1)FOREIGN KEYFOREIGN KEY (gender_id) REFERENCES gender_type (gender_type_id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE
- (Foreign key ID: 2)FOREIGN KEYFOREIGN KEY (person_type_id) REFERENCES person_type (person_type_id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE
- (Foreign key ID: 3)FOREIGN KEYFOREIGN KEY (party_id) REFERENCES party (party_id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE
sqlite_autoindex_person_1PRIMARY KEYPRIMARY KEY (person_id)
-CHECKCHECK(json_valid(elaboration) OR elaboration IS NULL)

Indexes

NameDefinition
sqlite_autoindex_person_1PRIMARY KEY (person_id)

Relations

er