refactor: employee
This commit is contained in:
parent
77739da154
commit
c51a403f2a
7 changed files with 637 additions and 277 deletions
|
|
@ -0,0 +1,99 @@
|
|||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the column `entryDate` on the `Employee` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `passportExpiryDate` on the `Employee` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `passportIssueDate` on the `Employee` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `passportIssuingCountry` on the `Employee` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `passportIssuingPlace` on the `Employee` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `passportNumber` on the `Employee` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `passportType` on the `Employee` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `previousPassportReference` on the `Employee` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `tm6Number` on the `Employee` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `visaExpiryDate` on the `Employee` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `visaIssueDate` on the `Employee` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `visaIssuingPlace` on the `Employee` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `visaNumber` on the `Employee` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `visaStayUntilDate` on the `Employee` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `visaType` on the `Employee` table. All the data in the column will be lost.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE "Employee" DROP COLUMN "entryDate",
|
||||
DROP COLUMN "passportExpiryDate",
|
||||
DROP COLUMN "passportIssueDate",
|
||||
DROP COLUMN "passportIssuingCountry",
|
||||
DROP COLUMN "passportIssuingPlace",
|
||||
DROP COLUMN "passportNumber",
|
||||
DROP COLUMN "passportType",
|
||||
DROP COLUMN "previousPassportReference",
|
||||
DROP COLUMN "tm6Number",
|
||||
DROP COLUMN "visaExpiryDate",
|
||||
DROP COLUMN "visaIssueDate",
|
||||
DROP COLUMN "visaIssuingPlace",
|
||||
DROP COLUMN "visaNumber",
|
||||
DROP COLUMN "visaStayUntilDate",
|
||||
DROP COLUMN "visaType",
|
||||
ADD COLUMN "workerType" TEXT;
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "EmployeePassport" (
|
||||
"id" TEXT NOT NULL,
|
||||
"number" TEXT NOT NULL,
|
||||
"type" TEXT NOT NULL,
|
||||
"issueDate" DATE NOT NULL,
|
||||
"expireDate" DATE NOT NULL,
|
||||
"issueCountry" TEXT NOT NULL,
|
||||
"issuePlace" TEXT NOT NULL,
|
||||
"previousPassportRef" TEXT,
|
||||
"employeeId" TEXT NOT NULL,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "EmployeePassport_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "EmployeeVisa" (
|
||||
"id" TEXT NOT NULL,
|
||||
"number" TEXT NOT NULL,
|
||||
"type" TEXT NOT NULL,
|
||||
"entryCount" INTEGER NOT NULL,
|
||||
"issueCountry" TEXT NOT NULL,
|
||||
"issuePlace" TEXT NOT NULL,
|
||||
"issueDate" DATE NOT NULL,
|
||||
"expireDate" DATE NOT NULL,
|
||||
"mrz" TEXT,
|
||||
"remark" TEXT,
|
||||
"employeeId" TEXT NOT NULL,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "EmployeeVisa_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "EmployeeInCountryNotice" (
|
||||
"id" TEXT NOT NULL,
|
||||
"noticeNumber" TEXT NOT NULL,
|
||||
"noticeDate" TEXT NOT NULL,
|
||||
"nextNoticeDate" DATE NOT NULL,
|
||||
"tmNumber" TEXT NOT NULL,
|
||||
"entryDate" DATE NOT NULL,
|
||||
"travelBy" TEXT NOT NULL,
|
||||
"travelFrom" TEXT NOT NULL,
|
||||
"employeeId" TEXT NOT NULL,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "EmployeeInCountryNotice_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "EmployeePassport" ADD CONSTRAINT "EmployeePassport_employeeId_fkey" FOREIGN KEY ("employeeId") REFERENCES "Employee"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "EmployeeVisa" ADD CONSTRAINT "EmployeeVisa_employeeId_fkey" FOREIGN KEY ("employeeId") REFERENCES "Employee"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "EmployeeInCountryNotice" ADD CONSTRAINT "EmployeeInCountryNotice_employeeId_fkey" FOREIGN KEY ("employeeId") REFERENCES "Employee"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
Loading…
Add table
Add a link
Reference in a new issue