chore: migration
This commit is contained in:
parent
00e09166be
commit
d75d134abf
1 changed files with 16 additions and 0 deletions
|
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
Warnings:
|
||||
|
||||
- The values [Redo] on the enum `TaskStatus` will be removed. If these variants are still used in the database, this will fail.
|
||||
|
||||
*/
|
||||
-- AlterEnum
|
||||
BEGIN;
|
||||
CREATE TYPE "TaskStatus_new" AS ENUM ('Pending', 'InProgress', 'Success', 'Failed', 'RedoCurrent', 'RedoOther', 'Validate', 'Complete', 'Canceled');
|
||||
ALTER TABLE "Task" ALTER COLUMN "taskStatus" DROP DEFAULT;
|
||||
ALTER TABLE "Task" ALTER COLUMN "taskStatus" TYPE "TaskStatus_new" USING ("taskStatus"::text::"TaskStatus_new");
|
||||
ALTER TYPE "TaskStatus" RENAME TO "TaskStatus_old";
|
||||
ALTER TYPE "TaskStatus_new" RENAME TO "TaskStatus";
|
||||
DROP TYPE "TaskStatus_old";
|
||||
ALTER TABLE "Task" ALTER COLUMN "taskStatus" SET DEFAULT 'Pending';
|
||||
COMMIT;
|
||||
Loading…
Add table
Add a link
Reference in a new issue