Skip to content

Scheduling infrastructure for absolutely everyone.

Added custom migration to prevent data loss

Alex van Andel9a8ee105550d
diff --git a/prisma/migrations/20210814175645_custom_inputs_type_enum/migration.sql b/prisma/migrations/20210814175645_custom_inputs_type_enum/migration.sql
new file mode 100644
index 00000000000..614c2c30d53
--- /dev/null
+++ b/prisma/migrations/20210814175645_custom_inputs_type_enum/migration.sql
@@ -0,0 +1,14 @@
+
+-- CreateEnum
+CREATE TYPE "EventTypeCustomInputType" AS ENUM ('text', 'textLong', 'number', 'bool');
+
+--- AlterTable
+ALTER TABLE "EventTypeCustomInput" RENAME COLUMN "type" TO "type_old";
+ALTER TABLE "EventTypeCustomInput" ADD COLUMN "type" "EventTypeCustomInputType";
+
+-- UpdateTable
+UPDATE "EventTypeCustomInput" SET "type" = CAST( "type_old" AS "EventTypeCustomInputType" );
+
+-- AlterTable
+ALTER TABLE "EventTypeCustomInput" ALTER COLUMN "type" SET NOT NULL;
+ALTER TABLE "EventTypeCustomInput" DROP COLUMN "type_old";