Tanmay Naik
08/07/2021, 11:09 AMRyan
08/09/2021, 6:50 AMTanmay Naik
08/09/2021, 6:55 AMError: Database error
11:57:09.507 Error querying the database: db error: ERROR: current transaction is aborted, commands ignored until end of transaction block
I found that there is no way to find out which query caused this, and can't rollback migrations without resetting the database. Locally it works fine, except that it resets.
I'm considering setting a CI flow to reset and seed the database in case of this specific error in production. Is there a better way though?Ryan
08/09/2021, 7:00 AMTanmay Naik
08/09/2021, 7:04 AM/*
Warnings:
- The values [Admin] on the enum `user_role` will be removed. If these variants are still used in the database, this will fail.
*/
-- AlterEnum
BEGIN;
CREATE TYPE "user_role_new" AS ENUM ('CISO', 'DPO', 'Audit', 'Security', 'Owner', 'Viewer', 'Responder', 'Vendor');
ALTER TABLE "users" ALTER COLUMN "role" TYPE "user_role_new" USING ("role"::text::"user_role_new");
ALTER TYPE "user_role" RENAME TO "user_role_old";
ALTER TYPE "user_role_new" RENAME TO "user_role";
DROP TYPE "user_role_old";
COMMIT;
-- AlterTable
ALTER TABLE "companies" ADD COLUMN "is_vendor" BOOLEAN DEFAULT false,
ADD COLUMN "risk_level" TEXT,
ADD COLUMN "status" TEXT;
It's probably because of how it's doing the enum here?Tanmay Naik
08/09/2021, 7:14 AMTanmay Naik
08/09/2021, 7:14 AMRyan
08/09/2021, 7:41 AMTanmay Naik
08/09/2021, 7:44 AMRyan
08/09/2021, 7:48 AM