diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-21 01:10:04 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-21 01:10:04 +0300 |
commit | 8bdbf220176b3c4df35dbf01da3dc8b2d507f351 (patch) | |
tree | aaabfc8906f31a1f62d1b5adbcf65dad5cd13aa0 /db/post_migrate | |
parent | 81bf49d9ea87a9dae5f0fd46a2bde8243459a7b1 (diff) |
Add latest changes from gitlab-org/gitlab@12-10-stable-ee
Diffstat (limited to 'db/post_migrate')
-rw-r--r-- | db/post_migrate/20200325162730_schedule_backfill_push_rules_id_in_projects.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/db/post_migrate/20200325162730_schedule_backfill_push_rules_id_in_projects.rb b/db/post_migrate/20200325162730_schedule_backfill_push_rules_id_in_projects.rb index b25b3365e12..8ff3ab6aa0c 100644 --- a/db/post_migrate/20200325162730_schedule_backfill_push_rules_id_in_projects.rb +++ b/db/post_migrate/20200325162730_schedule_backfill_push_rules_id_in_projects.rb @@ -18,7 +18,10 @@ class ScheduleBackfillPushRulesIdInProjects < ActiveRecord::Migration[6.0] # Update one record that is connected to the instance value_to_be_updated_to = ScheduleBackfillPushRulesIdInProjects::PushRules.find_by(is_sample: true)&.id - execute "UPDATE application_settings SET push_rule_id = #{value_to_be_updated_to}" if value_to_be_updated_to + if value_to_be_updated_to + execute "UPDATE application_settings SET push_rule_id = #{value_to_be_updated_to} + WHERE id IN (SELECT MAX(id) FROM application_settings);" + end ApplicationSetting.expire |