fix production issues
Build & Push / Pipeline Tests (push) Failing after 59s
Build & Push / Build & Push Docker Image (push) Has been skipped
Test / Type Check (all packages) (push) Failing after 51s
Test / API Unit Tests (push) Has been skipped
Test / Homepage Unit Tests (push) Has been skipped
Test / Carplace Unit Tests (push) Has been skipped
Test / Admin Unit Tests (push) Has been skipped
Test / Dashboard Unit Tests (push) Has been skipped
Test / API Integration Tests (push) Has been skipped

This commit is contained in:
root
2026-08-12 16:48:41 -04:00
parent 53de25120a
commit 8fc88ffc14
117 changed files with 4717 additions and 1443 deletions
@@ -0,0 +1,5 @@
-- Phase 0: unique employee email per company + normalize existing emails.
UPDATE "employees" SET "email" = lower("email") WHERE "email" <> lower("email");
-- If duplicate (companyId, email) rows exist, this statement fails intentionally so operators resolve data before enforcing uniqueness.
CREATE UNIQUE INDEX IF NOT EXISTS "employees_companyId_email_key" ON "employees"("companyId", "email");
@@ -0,0 +1,8 @@
-- Phase 1: outbox leasing for multi-worker safe dispatch
ALTER TABLE "notification_outbox" ADD COLUMN IF NOT EXISTS "locked_at" TIMESTAMP(3);
ALTER TABLE "notification_outbox" ADD COLUMN IF NOT EXISTS "locked_by" TEXT;
ALTER TABLE "notification_outbox" ADD COLUMN IF NOT EXISTS "attempts" INTEGER NOT NULL DEFAULT 0;
ALTER TABLE "notification_outbox" ADD COLUMN IF NOT EXISTS "available_at" TIMESTAMP(3);
CREATE INDEX IF NOT EXISTS "notification_outbox_status_available_at_idx"
ON "notification_outbox"("status", "available_at");
+7
View File
@@ -1513,7 +1513,9 @@ model Employee {
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@unique([companyId, email])
@@index([companyId])
@@index([email])
@@map("employees")
}
@@ -2085,10 +2087,15 @@ model NotificationOutbox {
payload Json
publishedAt DateTime?
failureReason String?
lockedAt DateTime? @map("locked_at")
lockedBy String? @map("locked_by")
attempts Int @default(0)
availableAt DateTime? @map("available_at")
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([status, createdAt])
@@index([status, availableAt])
@@map("notification_outbox")
}