From 14575893010add4db926c3e8517c360ea62625c2 Mon Sep 17 00:00:00 2001 From: Vipul A M Date: Sat, 10 Aug 2013 22:21:25 +0530 Subject: [PATCH] Remove sqlite specific`supports_autoincrement?` which always defaults to true --- .../connection_adapters/sqlite3_adapter.rb | 11 +---------- activerecord/test/schema/sqlite_specific_schema.rb | 7 ++----- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb index df489a5b1f..472a96400d 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb @@ -180,11 +180,6 @@ module ActiveRecord true end - # Returns true - def supports_autoincrement? #:nodoc: - true - end - def supports_index_sort_order? true end @@ -606,11 +601,7 @@ module ActiveRecord end def default_primary_key_type - if supports_autoincrement? - 'INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL' - else - 'INTEGER PRIMARY KEY NOT NULL' - end + 'INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL' end def translate_exception(exception, message) diff --git a/activerecord/test/schema/sqlite_specific_schema.rb b/activerecord/test/schema/sqlite_specific_schema.rb index e9ddeb32cf..b7aff4f47d 100644 --- a/activerecord/test/schema/sqlite_specific_schema.rb +++ b/activerecord/test/schema/sqlite_specific_schema.rb @@ -1,9 +1,6 @@ ActiveRecord::Schema.define do - # For sqlite 3.1.0+, make a table with an autoincrement column - if supports_autoincrement? - create_table :table_with_autoincrement, :force => true do |t| - t.column :name, :string - end + create_table :table_with_autoincrement, :force => true do |t| + t.column :name, :string end execute "DROP TABLE fk_test_has_fk" rescue nil