Skip to content

Commit 1b4679e

Browse files
committed
Refs 4313: drop tasks repo_uuid
1 parent 0a67ce3 commit 1b4679e

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed

db/migrations.latest

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20240814132436
1+
20240814145645
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
BEGIN;
2+
3+
alter table tasks add column if not exists repository_uuid UUID;
4+
5+
CREATE OR REPLACE VIEW ready_tasks AS
6+
SELECT *
7+
FROM tasks
8+
WHERE started_at IS NULL
9+
AND (status != 'canceled' OR status is null)
10+
AND id NOT IN (
11+
SELECT task_id
12+
FROM task_dependencies JOIN tasks ON dependency_id = id
13+
WHERE finished_at IS NULL
14+
)
15+
ORDER BY priority DESC, queued_at ASC;
16+
17+
COMMIT;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
BEGIN;
2+
3+
DROP VIEW if exists ready_tasks;
4+
5+
alter table tasks drop column if exists repository_uuid;
6+
7+
CREATE OR REPLACE VIEW ready_tasks AS
8+
SELECT *
9+
FROM tasks
10+
WHERE started_at IS NULL
11+
AND (status != 'canceled' OR status is null)
12+
AND id NOT IN (
13+
SELECT task_id
14+
FROM task_dependencies JOIN tasks ON dependency_id = id
15+
WHERE finished_at IS NULL
16+
)
17+
ORDER BY priority DESC, queued_at ASC;
18+
19+
20+
COMMIT;

0 commit comments

Comments
 (0)