summaryrefslogtreecommitdiff
path: root/lib/gitlab
diff options
context:
space:
mode:
authorTiago Botelho <tiagonbotelho@hotmail.com>2017-04-10 11:23:28 +0100
committerTiago Botelho <tiagonbotelho@hotmail.com>2017-04-11 20:20:19 +0100
commitc41df67676c46c09642a0437c5b915ca4f93a521 (patch)
treeaf9a63917471525006c4c7866b58d2656846e251 /lib/gitlab
parent069c54a7d7a1d1d6ec1dc48c4212139eff6735df (diff)
downloadgitlab-ce-c41df67676c46c09642a0437c5b915ca4f93a521.tar.gz
removes redundant code from database.rb29056-backport-ee-cleanup-database-file
Diffstat (limited to 'lib/gitlab')
-rw-r--r--lib/gitlab/database.rb8
-rw-r--r--lib/gitlab/database/migration_helpers.rb8
2 files changed, 12 insertions, 4 deletions
diff --git a/lib/gitlab/database.rb b/lib/gitlab/database.rb
index 63b8d0d3b9d..d0bd1299671 100644
--- a/lib/gitlab/database.rb
+++ b/lib/gitlab/database.rb
@@ -57,16 +57,16 @@ module Gitlab
postgresql? ? "RANDOM()" : "RAND()"
end
- def true_value
- if Gitlab::Database.postgresql?
+ def self.true_value
+ if postgresql?
"'t'"
else
1
end
end
- def false_value
- if Gitlab::Database.postgresql?
+ def self.false_value
+ if postgresql?
"'f'"
else
0
diff --git a/lib/gitlab/database/migration_helpers.rb b/lib/gitlab/database/migration_helpers.rb
index 525aa920328..21f1b32d467 100644
--- a/lib/gitlab/database/migration_helpers.rb
+++ b/lib/gitlab/database/migration_helpers.rb
@@ -114,6 +114,14 @@ module Gitlab
execute('SET statement_timeout TO 0') if Database.postgresql?
end
+ def true_value
+ Database.true_value
+ end
+
+ def false_value
+ Database.false_value
+ end
+
# Updates the value of a column in batches.
#
# This method updates the table in batches of 5% of the total row count.