mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Make sqlite adapter pass all tests
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2315 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
119855c438
commit
6d4a4a0d2e
2 changed files with 11 additions and 3 deletions
|
@ -166,7 +166,7 @@ module ActiveRecord
|
|||
execute("PRAGMA index_list(#{table_name})", name).map do |row|
|
||||
index = IndexDefinition.new(table_name, row['name'])
|
||||
index.unique = row['unique'] != '0'
|
||||
index.columns = execute("PRAGMA index_info(#{index.name})").map { |col| col['name'] }
|
||||
index.columns = execute("PRAGMA index_info('#{index.name}')").map { |col| col['name'] }
|
||||
index
|
||||
end
|
||||
end
|
||||
|
@ -188,8 +188,14 @@ module ActiveRecord
|
|||
'SQLite'
|
||||
end
|
||||
|
||||
def remove_index(table_name, column_name)
|
||||
execute "DROP INDEX #{table_name}_#{column_name}_index"
|
||||
def remove_index(table_name, options={})
|
||||
if Hash === options
|
||||
index_name = options[:name]
|
||||
else
|
||||
index_name = "#{table_name}_#{options}_index"
|
||||
end
|
||||
|
||||
execute "DROP INDEX #{index_name}"
|
||||
end
|
||||
|
||||
def add_column(table_name, column_name, type, options = {})
|
||||
|
|
|
@ -8,6 +8,8 @@ if ActiveRecord::Base.connection.supports_migrations?
|
|||
class Reminder < ActiveRecord::Base; end
|
||||
|
||||
class MigrationTest < Test::Unit::TestCase
|
||||
self.use_transactional_fixtures = false
|
||||
|
||||
def setup
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue