Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Use execute over execute_sql.

Pavel Balashoufa67e0436dae
diff --git a/db/migrate/20201125121949_remove_renamed_cron_job.rb b/db/migrate/20201125121949_remove_renamed_cron_job.rb
index c2515075fc6..be642846ee2 100644
--- a/db/migrate/20201125121949_remove_renamed_cron_job.rb
+++ b/db/migrate/20201125121949_remove_renamed_cron_job.rb
@@ -27,12 +27,10 @@
#++
class RemoveRenamedCronJob < ActiveRecord::Migration[6.0]
- include ::Migration::Utils
-
def up
# The job has been renamed to JobStatus::Cron::ClearOldJobStatusJob
# the new job will be added on restarting the application but the old will still be in the database
# and will cause 'uninitialized constant' errors.
- execute_sql("DELETE FROM delayed_jobs WHERE handler LIKE '%job_class: Cron::ClearOldJobStatusJob%'")
+ execute("DELETE FROM delayed_jobs WHERE handler LIKE '%job_class: Cron::ClearOldJobStatusJob%'")
end
end
diff --git a/db/migrate/20220804112533_remove_notification_cleanup_job.rb b/db/migrate/20220804112533_remove_notification_cleanup_job.rb
index f92ae07203c..5f64f6d455a 100644
--- a/db/migrate/20220804112533_remove_notification_cleanup_job.rb
+++ b/db/migrate/20220804112533_remove_notification_cleanup_job.rb
@@ -27,10 +27,8 @@
#++
class RemoveNotificationCleanupJob < ActiveRecord::Migration[7.0]
- include ::Migration::Utils
-
def up
- execute_sql("DELETE FROM delayed_jobs WHERE handler LIKE '%job_class: Notifications::CleanupJob%'")
+ execute("DELETE FROM delayed_jobs WHERE handler LIKE '%job_class: Notifications::CleanupJob%'")
Setting
.where(name: 'notification_retention_period_days')
.delete_all
diff --git a/db/migrate/20230105073117_remove_renamed_date_alert_job.rb b/db/migrate/20230105073117_remove_renamed_date_alert_job.rb
index aec7f000008..e59bc347aa6 100644
--- a/db/migrate/20230105073117_remove_renamed_date_alert_job.rb
+++ b/db/migrate/20230105073117_remove_renamed_date_alert_job.rb
@@ -27,11 +27,9 @@
#++
class RemoveRenamedDateAlertJob < ActiveRecord::Migration[6.0]
- include ::Migration::Utils
-
def up
# The job has been renamed to Notifications::ScheduleDateAlertsNotificationsJob.
# The new job will be added on restarting the application.
- execute_sql("DELETE FROM delayed_jobs WHERE handler LIKE '%job_class: Notifications::CreateDateAlertsNotificationsJob%'")
+ execute("DELETE FROM delayed_jobs WHERE handler LIKE '%job_class: Notifications::CreateDateAlertsNotificationsJob%'")
end
end
diff --git a/modules/storages/db/migrate/20231009135807_remove_renamed_cronjobs.rb b/modules/storages/db/migrate/20231009135807_remove_renamed_cronjobs.rb
index 7454c8c893b..c6fe00093ae 100644
--- a/modules/storages/db/migrate/20231009135807_remove_renamed_cronjobs.rb
+++ b/modules/storages/db/migrate/20231009135807_remove_renamed_cronjobs.rb
@@ -27,11 +27,9 @@
#++
class RemoveRenamedCronjobs < ActiveRecord::Migration[7.0]
- include ::Migration::Utils
-
def up
- execute_sql("DELETE FROM delayed_jobs WHERE handler LIKE '%job_class: CleanupUncontaineredFileLinksJob%'")
- execute_sql("DELETE FROM delayed_jobs WHERE handler LIKE '%job_class: ManageNextcloudIntegrationJob%'")
+ execute("DELETE FROM delayed_jobs WHERE handler LIKE '%job_class: CleanupUncontaineredFileLinksJob%'")
+ execute("DELETE FROM delayed_jobs WHERE handler LIKE '%job_class: ManageNextcloudIntegrationJob%'")
end
def down; end