Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #6588: sqlite_autoincrement.diff

File sqlite_autoincrement.diff, 0.8 kB (added by careo, 2 years ago)
  • lib/active_record/connection_adapters/sqlite_adapter.rb

    old new  
    107107      end 
    108108 
    109109      def native_database_types #:nodoc: 
    110        
     110        types =
    111111          :primary_key => "INTEGER PRIMARY KEY NOT NULL", 
    112112          :string      => { :name => "varchar", :limit => 255 }, 
    113113          :text        => { :name => "text" }, 
     
    121121          :binary      => { :name => "blob" }, 
    122122          :boolean     => { :name => "boolean" } 
    123123        } 
     124        types[:primary_key] = "INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL" if sqlite_version >= "3.1.0" 
     125        types 
    124126      end 
    125127 
    126128