feat: add bank field

This commit is contained in:
Methapon2001 2024-08-02 17:30:29 +07:00
parent 3e4709d8ff
commit 0bd3ce55a7
3 changed files with 34 additions and 3 deletions

View file

@ -0,0 +1,20 @@
/*
Warnings:
- Added the required column `accountType` to the `BranchBank` table without a default value. This is not possible if the table is not empty.
- Added the required column `bankBranch` to the `BranchBank` table without a default value. This is not possible if the table is not empty.
- Added the required column `currentlyUse` to the `BranchBank` table without a default value. This is not possible if the table is not empty.
- Made the column `branchId` on table `BranchBank` required. This step will fail if there are existing NULL values in that column.
*/
-- DropForeignKey
ALTER TABLE "BranchBank" DROP CONSTRAINT "BranchBank_branchId_fkey";
-- AlterTable
ALTER TABLE "BranchBank" ADD COLUMN "accountType" TEXT NOT NULL,
ADD COLUMN "bankBranch" TEXT NOT NULL,
ADD COLUMN "currentlyUse" BOOLEAN NOT NULL,
ALTER COLUMN "branchId" SET NOT NULL;
-- AddForeignKey
ALTER TABLE "BranchBank" ADD CONSTRAINT "BranchBank_branchId_fkey" FOREIGN KEY ("branchId") REFERENCES "Branch"("id") ON DELETE CASCADE ON UPDATE CASCADE;

View file

@ -239,13 +239,16 @@ model Branch {
}
model BranchBank {
id String @id @default(uuid())
id String @id @default(uuid())
bankName String
bankBranch String
accountName String
accountNumber String
accountType String
currentlyUse Boolean
branch Branch? @relation(fields: [branchId], references: [id])
branchId String?
branch Branch @relation(fields: [branchId], references: [id], onDelete: Cascade)
branchId String
}
model BranchContact {