aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xactiverecord/lib/active_record/connection_adapters/abstract_adapter.rb4
-rwxr-xr-xactiverecord/lib/active_record/connection_adapters/mysql_adapter.rb4
2 files changed, 6 insertions, 2 deletions
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)