We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9735290 commit a3d554eCopy full SHA for a3d554e
1 file changed
Scripts/Migrations/2.sql
@@ -0,0 +1,26 @@
1
+CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
2
+
3
+CREATE TABLE TaskPrototype
4
+(
5
+UUID UUID PRIMARY KEY,
6
+CronExpression varchar(25)
7
+);
8
9
+ALTER TABLE Task
10
+ADD TaskPrototype UUID NOT NULL DEFAULT uuid_generate_v4();
11
12
+insert into TaskPrototype
13
+select TaskPrototype from Task;
14
15
16
+ALTER COLUMN TaskPrototype
17
+DROP DEFAULT;
18
19
20
+ADD CONSTRAINT task_taskprototype_fkey
21
+FOREIGN KEY (TaskPrototype)
22
+REFERENCES TaskPrototype (UUID) ON DELETE CASCADE;
23
24
+update dbversion
25
+set version = 3
26
+where version = 2;
0 commit comments