diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-04-12 14:13:46 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-04-12 14:13:46 +0000 |
commit | 1ca5f0543c2429f8d3fd417550ea8e4c3018fdd5 (patch) | |
tree | 8d0a0810c7ea2f97b0821dc8a06de01fa6f4ed6b /lib/gitlab | |
parent | 50715a9292c086bb1969dc0207581bbd3d700563 (diff) | |
parent | c41df67676c46c09642a0437c5b915ca4f93a521 (diff) | |
download | gitlab-ce-1ca5f0543c2429f8d3fd417550ea8e4c3018fdd5.tar.gz |
Merge branch '29056-backport-ee-cleanup-database-file' into 'master'
removes redundant code from database.rb
Closes #29056
See merge request !10583
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/database.rb | 8 | ||||
-rw-r--r-- | lib/gitlab/database/migration_helpers.rb | 8 |
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. |