Skip to content

Commit b4089e8

Browse files
committed
Make sure update script of lantern.tasks only triggers if the table exists (async_tasks are enabled)
1 parent bc64c8a commit b4089e8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lantern_hnsw/sql/updates/0.5.0--0.6.0.sql

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
ALTER TABLE lantern.tasks ADD COLUMN pg_cron_jobid bigint default null;
1+
DO $$
2+
BEGIN
3+
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema = 'lantern' AND table_name = 'tasks') THEN
4+
ALTER TABLE lantern.tasks ADD COLUMN pg_cron_jobid bigint DEFAULT NULL;
5+
END IF;
6+
END $$;
27
CREATE OR REPLACE FUNCTION _lantern_internal.async_task_finalizer_trigger() RETURNS TRIGGER AS $$
38
DECLARE
49
res RECORD;

0 commit comments

Comments
 (0)