mirror of
https://github.com/redmine/redmine.git
synced 2025-12-17 05:50:29 +01:00
add Redmine::Database.sqlite? as with postgresql? and postgresql?
git-svn-id: http://svn.redmine.org/redmine/trunk@19711 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -21,6 +21,11 @@ module Redmine
|
|||||||
# Helper module to get information about the Redmine database
|
# Helper module to get information about the Redmine database
|
||||||
module Database
|
module Database
|
||||||
class << self
|
class << self
|
||||||
|
# Returns true if the database is SQLite
|
||||||
|
def sqlite?
|
||||||
|
ActiveRecord::Base.connection.adapter_name =~ /sqlite/i
|
||||||
|
end
|
||||||
|
|
||||||
# Returns true if the database is PostgreSQL
|
# Returns true if the database is PostgreSQL
|
||||||
def postgresql?
|
def postgresql?
|
||||||
/postgresql/i.match?(ActiveRecord::Base.connection.adapter_name)
|
/postgresql/i.match?(ActiveRecord::Base.connection.adapter_name)
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ class ActiveSupport::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def sqlite?
|
def sqlite?
|
||||||
ActiveRecord::Base.connection.adapter_name =~ /sqlite/i
|
Redmine::Database.sqlite?
|
||||||
end
|
end
|
||||||
|
|
||||||
def mysql?
|
def mysql?
|
||||||
|
|||||||
Reference in New Issue
Block a user