Add MySQL specific active_record_load_schema (stop using default null

for id column)
This commit is contained in:
Ernesto Tagwerker 2017-05-09 10:00:09 -04:00
parent 20e30e43bb
commit ef9e62adc3
3 changed files with 14 additions and 1 deletions

View file

@ -1,6 +1,6 @@
require 'support/active_record/database_setup' require 'support/active_record/database_setup'
require 'support/active_record/schema_setup' require 'support/active_record/schema_setup'
require 'support/active_record/mysql_schema_setup'
module MySQL2Helper module MySQL2Helper
puts "Active Record #{ActiveRecord::VERSION::STRING}, mysql2" puts "Active Record #{ActiveRecord::VERSION::STRING}, mysql2"

View file

@ -0,0 +1,12 @@
def active_record_load_schema
ActiveRecord::Schema.define do
create_table :users, :id => false, :force => true do |t|
t.column :id, "int(11) auto_increment PRIMARY KEY"
t.integer :name
end
create_table :agents, :id => false, :force => true do |t|
t.integer :name
end
end
end

View file

@ -1,5 +1,6 @@
require 'support/active_record/database_setup' require 'support/active_record/database_setup'
require 'support/active_record/schema_setup' require 'support/active_record/schema_setup'
require 'support/active_record/mysql_schema_setup'
module MySQLHelper module MySQLHelper
puts "Active Record #{ActiveRecord::VERSION::STRING}, mysql" puts "Active Record #{ActiveRecord::VERSION::STRING}, mysql"