1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Remove sqlite specificsupports_autoincrement? which always defaults to true

This commit is contained in:
Vipul A M 2013-08-10 22:21:25 +05:30
parent 4f5f59a492
commit 1457589301
2 changed files with 3 additions and 15 deletions

View file

@ -180,11 +180,6 @@ module ActiveRecord
true true
end end
# Returns true
def supports_autoincrement? #:nodoc:
true
end
def supports_index_sort_order? def supports_index_sort_order?
true true
end end
@ -606,11 +601,7 @@ module ActiveRecord
end end
def default_primary_key_type def default_primary_key_type
if supports_autoincrement? 'INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL'
'INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL'
else
'INTEGER PRIMARY KEY NOT NULL'
end
end end
def translate_exception(exception, message) def translate_exception(exception, message)

View file

@ -1,9 +1,6 @@
ActiveRecord::Schema.define do ActiveRecord::Schema.define do
# For sqlite 3.1.0+, make a table with an autoincrement column create_table :table_with_autoincrement, :force => true do |t|
if supports_autoincrement? t.column :name, :string
create_table :table_with_autoincrement, :force => true do |t|
t.column :name, :string
end
end end
execute "DROP TABLE fk_test_has_fk" rescue nil execute "DROP TABLE fk_test_has_fk" rescue nil