jws-backend/prisma/migrations/20240820053920_update_customer_structure/migration.sql

57 lines
3.5 KiB
MySQL
Raw Permalink Normal View History

/*
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;