sozsoft-platform/configs/seeds/postgres/object/Hr_T_JobApplication.sql

30 lines
1.1 KiB
MySQL
Raw Normal View History

2026-10-06 11:24:30 +00:00
CREATE TABLE IF NOT EXISTS public."Hr_T_JobApplication"
(
"Id" uuid NOT NULL DEFAULT gen_random_uuid(),
"TenantId" uuid NULL,
"CandidateId" uuid NOT NULL,
"JobPostingId" uuid NOT NULL,
"CandidateName" varchar(256) NULL,
"PostingTitle" varchar(256) NULL,
"ApplicationDate" date NOT NULL,
"SourceId" uuid NULL,
"OwnerUserId" uuid NULL,
"Stage" varchar(32) NOT NULL DEFAULT 'Applied',
"RejectionReasonId" uuid NULL,
"RejectionNote" varchar(1024) NULL,
"AverageScore" numeric(5, 2) NULL,
"SortOrder" integer NOT NULL DEFAULT 0,
"Notes" text NULL,
"IsActive" boolean NOT NULL DEFAULT TRUE,
"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,
CONSTRAINT "PK_Hr_T_JobApplication" PRIMARY KEY ("Id")
);
CREATE UNIQUE INDEX IF NOT EXISTS "UX_Hr_T_JobApplication_CandidatePosting" ON public."Hr_T_JobApplication" ("TenantId", "CandidateId", "JobPostingId") WHERE "IsDeleted" = FALSE;