party

Column Type PK Required Default
party_id VARCHAR Yes Yes
party_type_id ULID No Yes
party_name TEXT No Yes
elaboration TEXT No No
created_at TIMESTAMPTZ No No CURRENT_TIMESTAMP
created_by TEXT No No 'UNKNOWN'
updated_at TIMESTAMPTZ No No
updated_by TEXT No No
deleted_at TIMESTAMPTZ No No
deleted_by TEXT No No
activity_log TEXT No No

Foreign Keys

Column Name Foreign Key
party_type_id party_type_id references party_type.party_type_id

Indexes

Column Name Index Name
party_type_id idx_party__party_type_id__party_name
party_name idx_party__party_type_id__party_name
party_id sqlite_autoindex_party_1

SQL DDL

CREATE TABLE "party" (
    "party_id" VARCHAR PRIMARY KEY NOT NULL,
    "party_type_id" ULID 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"("party_type_id")
)