summaryrefslogtreecommitdiffstats
path: root/lib/redmine/database.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/redmine/database.rb')
-rw-r--r--lib/redmine/database.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/redmine/database.rb b/lib/redmine/database.rb
index d8b4b7ccb..89a80129b 100644
--- a/lib/redmine/database.rb
+++ b/lib/redmine/database.rb
@@ -44,6 +44,11 @@ module Redmine
end
end
+ # Returns true if the database is MySQL
+ def mysql?
+ (ActiveRecord::Base.connection.adapter_name =~ /mysql/i).present?
+ end
+
# Returns a SQL statement for case/accent (if possible) insensitive match
def like(left, right, options={})
neg = (options[:match] == false ? 'NOT ' : '')