From b12babdc09311c04038cb11a5c7ec59342b5bcfc Mon Sep 17 00:00:00 2001 From: Methapon Metanipat Date: Tue, 17 Sep 2024 10:45:21 +0700 Subject: [PATCH] chore: update migration --- .../migration.sql | 29 +++++++++++++++++++ prisma/schema.prisma | 14 +++++++-- 2 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 prisma/migrations/20240917034510_add_missing_meta/migration.sql diff --git a/prisma/migrations/20240917034510_add_missing_meta/migration.sql b/prisma/migrations/20240917034510_add_missing_meta/migration.sql new file mode 100644 index 0000000..652ffed --- /dev/null +++ b/prisma/migrations/20240917034510_add_missing_meta/migration.sql @@ -0,0 +1,29 @@ +/* + Warnings: + + - Added the required column `updatedAt` to the `CustomerBranchCitizen` table without a default value. This is not possible if the table is not empty. + - Added the required column `updatedAt` to the `CustomerBranchCommercialRegis` table without a default value. This is not possible if the table is not empty. + - Added the required column `updatedAt` to the `CustomerBranchHouseRegis` table without a default value. This is not possible if the table is not empty. + - Added the required column `updatedAt` to the `CustomerBranchPoa` table without a default value. This is not possible if the table is not empty. + - Added the required column `updatedAt` to the `CustomerBranchVatRegis` table without a default value. This is not possible if the table is not empty. + +*/ +-- AlterTable +ALTER TABLE "CustomerBranchCitizen" ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, +ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL; + +-- AlterTable +ALTER TABLE "CustomerBranchCommercialRegis" ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, +ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL; + +-- AlterTable +ALTER TABLE "CustomerBranchHouseRegis" ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, +ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL; + +-- AlterTable +ALTER TABLE "CustomerBranchPoa" ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, +ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL; + +-- AlterTable +ALTER TABLE "CustomerBranchVatRegis" ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, +ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index dc358f4..c492292 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -558,10 +558,14 @@ model CustomerBranchCitizen { districtId String? subDistrict SubDistrict? @relation(fields: [subDistrictId], references: [id], onDelete: SetNull) subDistrictId String? + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt } model CustomerBranchPoa { - id String @id @default(cuid()) + id String @id @default(cuid()) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt } model CustomerBranchHouseRegis { @@ -610,6 +614,8 @@ model CustomerBranchHouseRegis { fatherFullNameEN String? fatherCitizenId String fatherNationality String? + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt } enum CommercialType { @@ -627,10 +633,14 @@ model CustomerBranchCommercialRegis { fullNameEN String registrationDate String romanLetter String? + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt } model CustomerBranchVatRegis { - id String @id @default(cuid()) + id String @id @default(cuid()) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt } model Employee {