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" VARCHAR NOT NULL,
"person_first_name" TEXT NOT NULL,
"person_middle_name" TEXT,
"person_last_name" TEXT NOT NULL,
"honorific_prefix" TEXT,
"honorific_suffix" TEXT,
"gender_id" TEXT 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("person_id") REFERENCES "party"("party_id"),
FOREIGN KEY("gender_id") REFERENCES "gender_type"("code"),
UNIQUE("person_id")
)

Columns

NameTypeDefaultNullableParentsComment
person_idVARCHARfalseparty{“isSqlDomainZodDescrMeta”:true ,“isVarChar”:true }
person_first_nameTEXTfalseThe first name of the person.
person_middle_nameTEXTtrueThe middle name of the person, if applicable.
person_last_nameTEXTfalseThe last name of the person.
honorific_prefixTEXTtrueAn honorific prefix for the person, such as “Mr.”, “Ms.”, or “Dr.”
honorific_suffixTEXTtrueAn honorific suffix for the person, such as “Jr.” or “Sr.”
gender_idTEXTfalsegender_type
elaborationTEXTtrueAny elaboration needed for the person.
created_atTIMESTAMPTZCURRENT_TIMESTAMPtrue
created_byTEXT’UNKNOWN’true
updated_atTIMESTAMPTZtrue
updated_byTEXTtrue
deleted_atTIMESTAMPTZtrue
deleted_byTEXTtrue
activity_logTEXTtrue{“isSqlDomainZodDescrMeta”:true ,“isJsonSqlDomain”:true }

Constraints

NameTypeDefinition
- (Foreign key ID: 0)FOREIGN KEYFOREIGN KEY (gender_id) REFERENCES gender_type (code) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE
- (Foreign key ID: 1)FOREIGN KEYFOREIGN KEY (person_id) REFERENCES party (party_id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE
sqlite_autoindex_person_1UNIQUEUNIQUE (person_id)
-CHECKCHECK(json_valid(elaboration) OR elaboration IS NULL)

Indexes

NameDefinition
idx_person__person_id__person_first_name__person_middle_name__person_last_nameCREATE INDEX “idx_person__person_id__person_first_name__person_middle_name__person_last_name” ON “person”(“person_id”, “person_first_name”, “person_middle_name”, “person_last_name”)
sqlite_autoindex_person_1UNIQUE (person_id)

Relations

er