-- Create Table
CREATE TABLE IF NOT EXISTS dbo."Prj_T_Customer" (
    "Id"                   UUID          NOT NULL CONSTRAINT "PK_Prj_T_Customer" PRIMARY KEY,
    "TenantId"             UUID          NULL,
    "Name"                 VARCHAR(300)  NOT NULL,
    "ContactName"          VARCHAR(200)  NULL,
    "Email"                VARCHAR(200)  NULL,
    "Phone"                VARCHAR(50)   NULL,
    "CreationTime"         TIMESTAMP     NOT NULL DEFAULT (NOW() AT TIME ZONE 'UTC'),
    "CreatorId"            UUID          NULL,
    "LastModificationTime" TIMESTAMP     NULL,
    "LastModifierId"       UUID          NULL,
    "IsDeleted"            BOOLEAN       NOT NULL DEFAULT FALSE,
    "DeletionTime"         TIMESTAMP     NULL,
    "DeleterId"            UUID          NULL
);

CREATE INDEX IF NOT EXISTS "IX_Prj_T_Customer_TenantId_Name" ON dbo."Prj_T_Customer" ("TenantId" ASC, "Name" ASC);
