mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
Add MySQL specific active_record_load_schema (stop using default null
for id column)
This commit is contained in:
parent
20e30e43bb
commit
ef9e62adc3
3 changed files with 14 additions and 1 deletions
|
@ -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"
|
||||||
|
|
12
spec/support/active_record/mysql_schema_setup.rb
Normal file
12
spec/support/active_record/mysql_schema_setup.rb
Normal 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
|
|
@ -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"
|
||||||
|
|
Loading…
Reference in a new issue