From 9e3b3a9bde1c4e2692f3cde45a1e2c8ecb51f167 Mon Sep 17 00:00:00 2001 From: Esdras Renan Date: Thu, 16 Oct 2025 00:07:29 -0300 Subject: [PATCH] fix: corrige migration de provisioning e destrava deploy --- .../20251015223259_add_company_provisioning_code/migration.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/prisma/migrations/20251015223259_add_company_provisioning_code/migration.sql b/prisma/migrations/20251015223259_add_company_provisioning_code/migration.sql index 4990a9a..bbbd95b 100644 --- a/prisma/migrations/20251015223259_add_company_provisioning_code/migration.sql +++ b/prisma/migrations/20251015223259_add_company_provisioning_code/migration.sql @@ -23,7 +23,8 @@ CREATE TABLE "new_Company" ( "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, "updatedAt" DATETIME NOT NULL ); -INSERT INTO "new_Company" ("address", "cnpj", "contractedHoursPerMonth", "createdAt", "description", "domain", "id", "isAvulso", "name", "phone", "slug", "tenantId", "updatedAt") SELECT "address", "cnpj", "contractedHoursPerMonth", "createdAt", "description", "domain", "id", "isAvulso", "name", "phone", "slug", "tenantId", "updatedAt" FROM "Company"; +INSERT INTO "new_Company" ("address", "cnpj", "contractedHoursPerMonth", "createdAt", "description", "domain", "id", "isAvulso", "name", "phone", "slug", "tenantId", "updatedAt", "provisioningCode") +SELECT "address", "cnpj", "contractedHoursPerMonth", "createdAt", "description", "domain", "id", "isAvulso", "name", "phone", "slug", "tenantId", "updatedAt", lower(hex(randomblob(32))) FROM "Company"; DROP TABLE "Company"; ALTER TABLE "new_Company" RENAME TO "Company"; CREATE UNIQUE INDEX "Company_provisioningCode_key" ON "Company"("provisioningCode");