From 3f83794ac59d65d29fbd5d60066c684fd0938412 Mon Sep 17 00:00:00 2001 From: Gitead Date: Thu, 30 Jul 2026 18:38:11 -0400 Subject: [PATCH] fix: add missing migration for auto-MH-check fields and drop dead lab_rx_template column schema.prisma had autoMhCheckEnabled/DayOfWeek/Hour on User (added in fc3e8c0e) with no corresponding migration, so migrate deploy on a fresh DB left those columns missing and broke seeding. Also drops lab_rx_template.doctorName, a column that existed only in the DB (added by an old migration) but was never in schema.prisma or referenced by any app code. Co-Authored-By: Claude Sonnet 5 --- .../migration.sql | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 packages/db/prisma/migrations/20260730223240_add_auto_mh_check_fields/migration.sql diff --git a/packages/db/prisma/migrations/20260730223240_add_auto_mh_check_fields/migration.sql b/packages/db/prisma/migrations/20260730223240_add_auto_mh_check_fields/migration.sql new file mode 100644 index 00000000..169dfeb9 --- /dev/null +++ b/packages/db/prisma/migrations/20260730223240_add_auto_mh_check_fields/migration.sql @@ -0,0 +1,16 @@ +/* + Warnings: + + - You are about to drop the column `doctorName` on the `lab_rx_template` table. All the data in the column will be lost. + +*/ +-- AlterTable +ALTER TABLE "Patient" ALTER COLUMN "updatedAt" DROP DEFAULT; + +-- AlterTable +ALTER TABLE "User" ADD COLUMN "autoMhCheckDayOfWeek" INTEGER NOT NULL DEFAULT 1, +ADD COLUMN "autoMhCheckEnabled" BOOLEAN NOT NULL DEFAULT false, +ADD COLUMN "autoMhCheckHour" INTEGER NOT NULL DEFAULT 13; + +-- AlterTable +ALTER TABLE "lab_rx_template" DROP COLUMN "doctorName";