Commit 0a58a8c8 authored by Douwe Maan's avatar Douwe Maan

Merge branch 'gitlab-database-fix' into 'master'

removes redundant code from gitlab database file

See merge request !9282
parents eb7b03af 53760bb8
...@@ -24,7 +24,7 @@ module Gitlab ...@@ -24,7 +24,7 @@ module Gitlab
def self.nulls_last_order(field, direction = 'ASC') def self.nulls_last_order(field, direction = 'ASC')
order = "#{field} #{direction}" order = "#{field} #{direction}"
if Gitlab::Database.postgresql? if postgresql?
order << ' NULLS LAST' order << ' NULLS LAST'
else else
# `field IS NULL` will be `0` for non-NULL columns and `1` for NULL # `field IS NULL` will be `0` for non-NULL columns and `1` for NULL
...@@ -38,7 +38,7 @@ module Gitlab ...@@ -38,7 +38,7 @@ module Gitlab
def self.nulls_first_order(field, direction = 'ASC') def self.nulls_first_order(field, direction = 'ASC')
order = "#{field} #{direction}" order = "#{field} #{direction}"
if Gitlab::Database.postgresql? if postgresql?
order << ' NULLS FIRST' order << ' NULLS FIRST'
else else
# `field IS NULL` will be `0` for non-NULL columns and `1` for NULL # `field IS NULL` will be `0` for non-NULL columns and `1` for NULL
...@@ -50,7 +50,7 @@ module Gitlab ...@@ -50,7 +50,7 @@ module Gitlab
end end
def self.random def self.random
Gitlab::Database.postgresql? ? "RANDOM()" : "RAND()" postgresql? ? "RANDOM()" : "RAND()"
end end
def true_value def true_value
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment