Added custom migration to prevent data loss
This commit is contained in:
parent
252a329f09
commit
9a8ee10555
1 changed files with 14 additions and 0 deletions
|
@ -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";
|
Loading…
Reference in a new issue