refactor: customer create and update process
This commit is contained in:
parent
b167a612b4
commit
5bb8da818c
6 changed files with 261 additions and 462 deletions
|
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the column `customerName` on the `Customer` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `customerNameEN` on the `Customer` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `personName` on the `Customer` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `personNameEN` on the `Customer` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `taxNo` on the `Customer` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `branchNo` on the `CustomerBranch` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `bussinessType` on the `CustomerBranch` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `bussinessTypeEN` on the `CustomerBranch` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `name` on the `CustomerBranch` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `nameEN` on the `CustomerBranch` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `taxNo` on the `CustomerBranch` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `zipCode` on the `CustomerBranch` table. All the data in the column will be lost.
|
||||
- Added the required column `birthDate` to the `Customer` table without a default value. This is not possible if the table is not empty.
|
||||
- Added the required column `firstName` to the `Customer` table without a default value. This is not possible if the table is not empty.
|
||||
- Added the required column `gender` to the `Customer` table without a default value. This is not possible if the table is not empty.
|
||||
- Added the required column `lastName` to the `Customer` table without a default value. This is not possible if the table is not empty.
|
||||
- Added the required column `businessType` to the `CustomerBranch` table without a default value. This is not possible if the table is not empty.
|
||||
- Added the required column `businessTypeEN` to the `CustomerBranch` table without a default value. This is not possible if the table is not empty.
|
||||
- Added the required column `workplace` to the `CustomerBranch` table without a default value. This is not possible if the table is not empty.
|
||||
- Added the required column `workplaceEN` to the `CustomerBranch` table without a default value. This is not possible if the table is not empty.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE "Customer" DROP COLUMN "customerName",
|
||||
DROP COLUMN "customerNameEN",
|
||||
DROP COLUMN "personName",
|
||||
DROP COLUMN "personNameEN",
|
||||
DROP COLUMN "taxNo",
|
||||
ADD COLUMN "birthDate" TIMESTAMP(3) NOT NULL,
|
||||
ADD COLUMN "firstName" TEXT NOT NULL,
|
||||
ADD COLUMN "firstNameEN" TEXT,
|
||||
ADD COLUMN "gender" TEXT NOT NULL,
|
||||
ADD COLUMN "lastName" TEXT NOT NULL,
|
||||
ADD COLUMN "lastNameEN" TEXT,
|
||||
ADD COLUMN "namePrefix" TEXT;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "CustomerBranch" DROP COLUMN "branchNo",
|
||||
DROP COLUMN "bussinessType",
|
||||
DROP COLUMN "bussinessTypeEN",
|
||||
DROP COLUMN "name",
|
||||
DROP COLUMN "nameEN",
|
||||
DROP COLUMN "taxNo",
|
||||
DROP COLUMN "zipCode",
|
||||
ADD COLUMN "businessType" TEXT NOT NULL,
|
||||
ADD COLUMN "businessTypeEN" TEXT NOT NULL,
|
||||
ADD COLUMN "citizenId" TEXT,
|
||||
ADD COLUMN "workplace" TEXT NOT NULL,
|
||||
ADD COLUMN "workplaceEN" TEXT NOT NULL,
|
||||
ALTER COLUMN "legalPersonNo" DROP NOT NULL,
|
||||
ALTER COLUMN "registerName" DROP NOT NULL,
|
||||
ALTER COLUMN "registerDate" DROP NOT NULL,
|
||||
ALTER COLUMN "authorizedCapital" DROP NOT NULL;
|
||||
2
prisma/migrations/20240820063852_add_field/migration.sql
Normal file
2
prisma/migrations/20240820063852_add_field/migration.sql
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
-- AlterTable
|
||||
ALTER TABLE "CustomerBranch" ADD COLUMN "legalPersonName" TEXT;
|
||||
13
prisma/migrations/20240820084114_update_field/migration.sql
Normal file
13
prisma/migrations/20240820084114_update_field/migration.sql
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the column `code` on the `Customer` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `legalPersonName` on the `CustomerBranch` table. All the data in the column will be lost.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE "Customer" DROP COLUMN "code";
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "CustomerBranch" DROP COLUMN "legalPersonName",
|
||||
ADD COLUMN "registerNameEN" TEXT;
|
||||
Loading…
Add table
Add a link
Reference in a new issue