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" VARCHAR NOT NULL,
"name" TEXT NOT NULL,
"alias" TEXT,
"description" TEXT,
"license" TEXT,
"federal_tax_id_num" TEXT,
"registration_date" TIMESTAMPTZ,
"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("organization_id") REFERENCES "party"("party_id"),
UNIQUE("organization_id", "name")
)

Columns

NameTypeDefaultNullableParentsComment
organization_idVARCHARfalseparty{“isSqlDomainZodDescrMeta”:true ,“isVarChar”:true }
nameTEXTfalseThe name of the organization.
aliasTEXTtrueAn alias or alternative name for the organization, if applicable.
descriptionTEXTtrueA description of the organization.
licenseTEXTtrueThe license number or identifier for the organization.
federal_tax_id_numTEXTtrueThe federal tax identification number of the organization.
registration_dateTIMESTAMPTZtrueThe date on which the organization was registered.
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
- (Foreign key ID: 0)FOREIGN KEYFOREIGN KEY (organization_id) REFERENCES party (party_id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE
sqlite_autoindex_organization_1UNIQUEUNIQUE (organization_id, name)
-CHECKCHECK(json_valid(elaboration) OR elaboration IS NULL)

Indexes

NameDefinition
idx_organization__organization_id__nameCREATE INDEX “idx_organization__organization_id__name” ON “organization”(“organization_id”, “name”)
sqlite_autoindex_organization_1UNIQUE (organization_id, name)

Relations

er