New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto-indexes in SQLite have no SQL definition in master table #377
Comments
right, it's not aligned with AR master (which already fixed this), try patching it as : ArJdbc::SQLite3.module_eval do
def indexes(table_name, name = nil) # :nodoc:
exec_query("PRAGMA index_list(#{quote_table_name(table_name)})", 'SCHEMA').map do |row|
name = row['name']; unique = row['unique'] != 0
columns = exec_query("PRAGMA index_info('#{name}')", 'SCHEMA').map { |col| col['name'] }
IndexDefinition.new(table_name, name, unique, columns)
end
end
end |
There also might be a related issue with this: Right now you're creating a temporary table in SQLite to perform all table alterations.
Therefore it returns just 0:Integer, and not ActiveRecord::Result
You can check it out yourself by cloning fusioneer-ltd/shiva@specs, installing your gems from source running |
right, my bad I did not test it actually just basically copied it from Rails master ... should work fine if we let the JDBC API (and thus SQLite3's driver) to handle the index resolution ... please try out master if you can or |
Seems to be working, thanks! |
I have a problem in
indexes
method ofarjdbc/sqlite3/adapter.rb
file.Auto-indexes in my SQLite database have not been populated with their responsive SQL statements in SQLite master table.
Therefore, I assume that index summary is not reliable, and shouldn't be used by jdbc adapter.
What I'm trying to do is to run these migrations and then rollback on this database: fusioneer-ltd/shiva/blob/specs/spec/fixtures/databases/ponies.sqlite. This error occurs whether it's a database created by hand, or with migrations.
I get an exception in jdbc-adapter, trying to look up indexes in it.
Stacktrace
The text was updated successfully, but these errors were encountered: