Skip to content

Organization

Description

Entity to store information about organizations. Each organization has a unique ID associated with it.

Table Definition
CREATE TABLE "organization" (
"organization_id" ULID PRIMARY KEY NOT NULL,
"party_id" VARCHAR NOT NULL,
"name" TEXT NOT NULL,
"alias" TEXT,
"description" TEXT,
"license" TEXT NOT NULL,
"federal_tax_id_num" TEXT,
"registration_date" DATE 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")
)

Columns

NameTypeDefaultNullableParentsComment
organization_idULIDfalse{“isSqlDomainZodDescrMeta”:true,“isUlid”:true}
party_idVARCHARfalseparty{“isSqlDomainZodDescrMeta”:true,“isVarChar”:true}
nameTEXTfalse
aliasTEXTtrue
descriptionTEXTtrue
licenseTEXTfalse
federal_tax_id_numTEXTtrue
registration_dateDATEfalse
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
organization_idPRIMARY KEYPRIMARY KEY (organization_id)
- (Foreign key ID: 0)FOREIGN KEYFOREIGN KEY (party_id) REFERENCES party (party_id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE
sqlite_autoindex_organization_1PRIMARY KEYPRIMARY KEY (organization_id)
-CHECKCHECK(json_valid(elaboration) OR elaboration IS NULL)

Indexes

NameDefinition
sqlite_autoindex_organization_1PRIMARY KEY (organization_id)

Relations

er