diff --git a/prisma/migrations/20240418042147_fix_missing_field/migration.sql b/prisma/migrations/20240418042147_fix_missing_field/migration.sql new file mode 100644 index 0000000..c22f622 --- /dev/null +++ b/prisma/migrations/20240418042147_fix_missing_field/migration.sql @@ -0,0 +1,12 @@ +/* + Warnings: + + - You are about to drop the column `componentId` on the `RoleMenuComponentPermission` table. All the data in the column will be lost. + - You are about to drop the column `componentTag` on the `RoleMenuComponentPermission` table. All the data in the column will be lost. + - Added the required column `userRole` to the `RoleMenuComponentPermission` table without a default value. This is not possible if the table is not empty. + +*/ +-- AlterTable +ALTER TABLE "RoleMenuComponentPermission" DROP COLUMN "componentId", +DROP COLUMN "componentTag", +ADD COLUMN "userRole" TEXT NOT NULL; diff --git a/prisma/migrations/20240418060611_add_hq_tel_field/migration.sql b/prisma/migrations/20240418060611_add_hq_tel_field/migration.sql new file mode 100644 index 0000000..ae17c14 --- /dev/null +++ b/prisma/migrations/20240418060611_add_hq_tel_field/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "Branch" ADD COLUMN "telephoneHq" TEXT; diff --git a/prisma/migrations/20240418060739_remove_optional_hq_tel/migration.sql b/prisma/migrations/20240418060739_remove_optional_hq_tel/migration.sql new file mode 100644 index 0000000..922dfa6 --- /dev/null +++ b/prisma/migrations/20240418060739_remove_optional_hq_tel/migration.sql @@ -0,0 +1,8 @@ +/* + Warnings: + + - Made the column `telephoneHq` on table `Branch` required. This step will fail if there are existing NULL values in that column. + +*/ +-- AlterTable +ALTER TABLE "Branch" ALTER COLUMN "telephoneHq" SET NOT NULL; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 4b648c5..47d0d8b 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -81,14 +81,12 @@ model MenuComponent { model RoleMenuComponentPermission { id String @id @default(uuid()) - componentId String - componentTag String + userRole String + permission String menuComponent MenuComponent @relation(fields: [menuComponentId], references: [id]) menuComponentId String - permission String - createdBy String? createdAt DateTime @default(now()) updateBy String? @@ -177,13 +175,14 @@ enum Status { } model Branch { - id String @id @default(uuid()) - code String - taxNo String - name String - nameEN String - address String - addressEN String + id String @id @default(uuid()) + code String + taxNo String + name String + nameEN String + address String + addressEN String + telephoneHq String province Province? @relation(fields: [provinceId], references: [id], onDelete: SetNull) provinceId String?