fix: unused field

This commit is contained in:
Methapon2001 2024-07-02 09:25:35 +07:00
parent d23e404196
commit 9a824f3ddf
3 changed files with 15 additions and 7 deletions

View file

@ -0,0 +1,15 @@
/*
Warnings:
- You are about to drop the column `createdAt` on the `EmployeeHistory` table. All the data in the column will be lost.
- You are about to drop the column `createdByUserId` on the `EmployeeHistory` table. All the data in the column will be lost.
- You are about to drop the column `timestamp` on the `EmployeeHistory` table. All the data in the column will be lost.
*/
-- DropForeignKey
ALTER TABLE "EmployeeHistory" DROP CONSTRAINT "EmployeeHistory_createdByUserId_fkey";
-- AlterTable
ALTER TABLE "EmployeeHistory" DROP COLUMN "createdAt",
DROP COLUMN "createdByUserId",
DROP COLUMN "timestamp";

View file

@ -352,7 +352,6 @@ model User {
customerBranchUpdated CustomerBranch[] @relation("CustomerBranchUpdatedByUser")
emplyeeCreated Employee[] @relation("EmployeeCreatedByUser")
employeUpdated Employee[] @relation("EmployeeUpdatedByUser")
employeeHistoryCreated EmployeeHistory[] @relation("EmployeeHistoryCreatedByUser")
employeeHistoryUpdated EmployeeHistory[] @relation("EmployeeHistoryUpdatedByUser")
employeeCheckupCreated EmployeeCheckup[] @relation("EmployeeCheckupCreatedByUser")
employeeCheckupUpdated EmployeeCheckup[] @relation("EmployeeCheckupUpdatedByUser")
@ -531,11 +530,6 @@ model EmployeeHistory {
valueBefore Json
valueAfter Json
timestamp DateTime @default(now())
createdAt DateTime @default(now())
createdBy User? @relation(name: "EmployeeHistoryCreatedByUser", fields: [createdByUserId], references: [id], onDelete: SetNull)
createdByUserId String?
updatedAt DateTime @updatedAt
updatedBy User? @relation(name: "EmployeeHistoryUpdatedByUser", fields: [updatedByUserId], references: [id], onDelete: SetNull)
updatedByUserId String?

View file

@ -690,7 +690,6 @@ export class EmployeeController extends Controller {
data: historyEntries.map((v) => ({
...v,
updatedByUserId: req.user.sub,
updatedBy: req.user.preferred_username,
masterId: employee.id,
})),
});