diff --git a/prisma/migrations/20240916063118_fix_missing_field/migration.sql b/prisma/migrations/20240916063118_fix_missing_field/migration.sql new file mode 100644 index 0000000..9902974 --- /dev/null +++ b/prisma/migrations/20240916063118_fix_missing_field/migration.sql @@ -0,0 +1,8 @@ +/* + Warnings: + + - Added the required column `customerName` to the `CustomerBranch` table without a default value. This is not possible if the table is not empty. + +*/ +-- AlterTable +ALTER TABLE "CustomerBranch" ADD COLUMN "customerName" TEXT NOT NULL; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 7843e1c..5c7c17e 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -441,9 +441,10 @@ model Customer { } model CustomerBranch { - id String @id @default(cuid()) - customer Customer @relation(fields: [customerId], references: [id], onDelete: Cascade) - customerId String + id String @id @default(cuid()) + customer Customer @relation(fields: [customerId], references: [id], onDelete: Cascade) + customerId String + customerName String code String codeCustomer String diff --git a/src/controllers/03-customer-branch-controller.ts b/src/controllers/03-customer-branch-controller.ts index a58df7a..98d7501 100644 --- a/src/controllers/03-customer-branch-controller.ts +++ b/src/controllers/03-customer-branch-controller.ts @@ -76,6 +76,7 @@ export type CustomerBranchCreate = ( } ) & { customerId: string; + customerName: string; telephoneNo: string; @@ -129,6 +130,7 @@ export type CustomerBranchUpdate = ( } ) & { customerId?: string; + customerName?: string; telephoneNo: string; diff --git a/src/controllers/03-customer-controller.ts b/src/controllers/03-customer-controller.ts index b29f410..b33d87b 100644 --- a/src/controllers/03-customer-controller.ts +++ b/src/controllers/03-customer-controller.ts @@ -68,6 +68,7 @@ export type CustomerCreate = { } ) & { customerId: string; + customerName: string; telephoneNo: string;