Skip to content

party

Description

Entity representing parties involved in business transactions.

Table Definition
CREATE TABLE "party" (
"party_id" VARCHAR PRIMARY KEY NOT NULL,
"party_type_id" TEXT NOT NULL,
"party_name" 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("party_type_id") REFERENCES "party_type"("code")
)

Columns

NameTypeDefaultNullableChildrenParentsComment
party_idVARCHARfalseparty_relation person organization organization_role device_party_relationship{“isSqlDomainZodDescrMeta”:true,“isVarChar”:true}
party_type_idTEXTfalseparty_type
party_nameTEXTfalseThe name of the party
elaborationTEXTtrueAny elaboration needed for the party.
created_atTIMESTAMPTZCURRENT_TIMESTAMPtrue
created_byTEXT’UNKNOWN’true
updated_atTIMESTAMPTZtrue
updated_byTEXTtrue
deleted_atTIMESTAMPTZtrue
deleted_byTEXTtrue
activity_logTEXTtrue{“isSqlDomainZodDescrMeta”:true,“isJsonSqlDomain”:true}

Constraints

NameTypeDefinition
party_idPRIMARY KEYPRIMARY KEY (party_id)
- (Foreign key ID: 0)FOREIGN KEYFOREIGN KEY (party_type_id) REFERENCES party_type (code) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE
sqlite_autoindex_party_1PRIMARY KEYPRIMARY KEY (party_id)
-CHECKCHECK(json_valid(elaboration) OR elaboration IS NULL)

Indexes

NameDefinition
idx_party__party_type_id__party_nameCREATE INDEX “idx_party__party_type_id__party_name” ON “party”(“party_type_id”, “party_name”)
sqlite_autoindex_party_1PRIMARY KEY (party_id)

Relations

er