summaryrefslogtreecommitdiff
path: root/db/post_migrate
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-02-22 16:34:45 -0600
committerDouwe Maan <douwe@selenight.nl>2017-02-23 09:32:42 -0600
commit0a5b670a9392f7f8c02e83f1c2e3ed4d2d67cfde (patch)
treeee9c8d00cbaf8920eb274abe688d4e44a4591c4e /db/post_migrate
parent32a7041030dcb95d9476b3cbcc5d3c036aae81f3 (diff)
downloadgitlab-ce-0a5b670a9392f7f8c02e83f1c2e3ed4d2d67cfde.tar.gz
Exclude migrations from Style/MutableConstant
Diffstat (limited to 'db/post_migrate')
-rw-r--r--db/post_migrate/20161011222551_remove_inactive_jira_service_properties.rb2
-rw-r--r--db/post_migrate/20161109150329_fix_project_records_with_invalid_visibility.rb14
2 files changed, 8 insertions, 8 deletions
diff --git a/db/post_migrate/20161011222551_remove_inactive_jira_service_properties.rb b/db/post_migrate/20161011222551_remove_inactive_jira_service_properties.rb
index eacc6d1b033..319d86ac159 100644
--- a/db/post_migrate/20161011222551_remove_inactive_jira_service_properties.rb
+++ b/db/post_migrate/20161011222551_remove_inactive_jira_service_properties.rb
@@ -2,7 +2,7 @@ class RemoveInactiveJiraServiceProperties < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = true
- DOWNTIME_REASON = "Removes all inactive jira_service properties".freeze
+ DOWNTIME_REASON = "Removes all inactive jira_service properties"
def up
execute("UPDATE services SET properties = '{}' WHERE services.type = 'JiraService' and services.active = false")
diff --git a/db/post_migrate/20161109150329_fix_project_records_with_invalid_visibility.rb b/db/post_migrate/20161109150329_fix_project_records_with_invalid_visibility.rb
index 823274b08c0..69007b8e8ed 100644
--- a/db/post_migrate/20161109150329_fix_project_records_with_invalid_visibility.rb
+++ b/db/post_migrate/20161109150329_fix_project_records_with_invalid_visibility.rb
@@ -14,15 +14,15 @@ class FixProjectRecordsWithInvalidVisibility < ActiveRecord::Migration
finder_sql =
projects
- .join(namespaces, Arel::Nodes::InnerJoin)
- .on(projects[:namespace_id].eq(namespaces[:id]))
- .where(projects[:visibility_level].gt(namespaces[:visibility_level]))
- .project(projects[:id], namespaces[:visibility_level])
- .take(BATCH_SIZE)
- .to_sql
+ .join(namespaces, Arel::Nodes::InnerJoin)
+ .on(projects[:namespace_id].eq(namespaces[:id]))
+ .where(projects[:visibility_level].gt(namespaces[:visibility_level]))
+ .project(projects[:id], namespaces[:visibility_level])
+ .take(BATCH_SIZE)
+ .to_sql
# Update matching rows in batches. Each batch can cause up to 3 UPDATE
- # statements, in addition to the SELECT: one per visibility_level
+ # statements, in addition to the SELECT: one per visibility_level
loop do
to_update = connection.exec_query(finder_sql)
break if to_update.rows.count == 0