Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions queue_job/migrations/12.0.1.0.1/post-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# License LGPL-3 or later (https://www.gnu.org/licenses/lgpl).

import odoo
from odoo.addons.queue_job.hooks.post_init_hook import post_init_hook


def migrate(cr, version):
Expand All @@ -17,5 +16,3 @@ def migrate(cr, version):
raise_if_not_found=False)
if cron_job and cron_job.exists() and cron_job.state != 'code':
cron_job.state = 'code'
# Ensure that the queue_job_notify trigger is in place
post_init_hook(cr, None)
10 changes: 10 additions & 0 deletions queue_job/migrations/12.0.1.0.1/pre-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright 2019 Versada UAB
# Copyright 2021 ACSONE SA/NV
# License LGPL-3 or later (https://www.gnu.org/licenses/lgpl).

from odoo.addons.queue_job.hooks.post_init_hook import post_init_hook


def migrate(cr, version):
# Ensure that the queue_job_notify trigger is in place
post_init_hook(cr, None)
11 changes: 11 additions & 0 deletions queue_job/migrations/12.0.2.1.0/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@


def migrate(cr, version):
# Disable trigger otherwise the update takes ages.
cr.execute(
"""
ALTER TABLE queue_job DISABLE TRIGGER queue_job_notify;
"""
)
if not column_exists(cr, "queue_job", "records"):
cr.execute(
"""
Expand All @@ -26,3 +32,8 @@ def migrate(cr, version):
WHERE records IS NULL;
"""
)
cr.execute(
"""
ALTER TABLE queue_job ENABLE TRIGGER queue_job_notify;
"""
)