mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
#332 - mysql2+jruby support, speedup
This commit is contained in:
parent
5b15b4cd90
commit
42aa52309c
1 changed files with 3 additions and 3 deletions
|
@ -54,14 +54,14 @@ module DatabaseCleaner::ActiveRecord
|
|||
|
||||
def tables_with_new_rows(connection)
|
||||
@db_name ||= connection.instance_variable_get('@config')[:database]
|
||||
result = connection.execute("SELECT table_name FROM information_schema.tables WHERE table_schema = '#{@db_name}' AND table_rows > 0")
|
||||
result.map{ |row| row[0] } - ['schema_migrations']
|
||||
result = connection.select_all("SELECT table_name FROM information_schema.tables WHERE table_schema = '#{@db_name}' AND table_rows > 0")
|
||||
result.map{ |row| row.values[0] } - ['schema_migrations']
|
||||
end
|
||||
|
||||
def information_schema_exists? connection
|
||||
@information_schema_exists ||=
|
||||
begin
|
||||
connection.execute("SELECT * FROM information_schema.tables")
|
||||
connection.execute("SELECT 1 FROM information_schema.tables")
|
||||
true
|
||||
rescue
|
||||
false
|
||||
|
|
Loading…
Reference in a new issue