From 0baf3444579a3fac780b58471db00045a9ac7cc5 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 16 Apr 2005 06:38:12 +0000 Subject: Made migrations create InnoDB tables per default git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1168 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../lib/active_record/connection_adapters/abstract_adapter.rb | 4 ++-- activerecord/lib/active_record/connection_adapters/mysql_adapter.rb | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb index b9a447152f..2be587dc79 100755 --- a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb @@ -378,8 +378,8 @@ module ActiveRecord end end - def create_table(name) - execute "CREATE TABLE #{name} (id #{native_database_types[:primary_key]})" + def create_table(name, options = "") + execute "CREATE TABLE #{name} (id #{native_database_types[:primary_key]}) #{options}" table_definition = yield TableDefinition.new table_definition.columns.each { |column_name, type, options| add_column(name, column_name, type, options) } end diff --git a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb index 57f3b6f5e9..89633639d3 100755 --- a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb @@ -190,6 +190,10 @@ module ActiveRecord execute "CREATE DATABASE #{name}" end + + def create_table(name) + super(name, "ENGINE=InnoDB") + end private def select(sql, name = nil) -- cgit v1.2.3