diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-16 06:38:12 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-16 06:38:12 +0000 |
commit | 0baf3444579a3fac780b58471db00045a9ac7cc5 (patch) | |
tree | 6522732e5d33ce8def7e85a740065e8fbd06b2de /activerecord | |
parent | 9dd8d3d3e4dc1b91cf8489ea9f3fee9bb0c27c65 (diff) | |
download | rails-0baf3444579a3fac780b58471db00045a9ac7cc5.tar.gz rails-0baf3444579a3fac780b58471db00045a9ac7cc5.tar.bz2 rails-0baf3444579a3fac780b58471db00045a9ac7cc5.zip |
Made migrations create InnoDB tables per default
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1168 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord')
-rwxr-xr-x | activerecord/lib/active_record/connection_adapters/abstract_adapter.rb | 4 | ||||
-rwxr-xr-x | activerecord/lib/active_record/connection_adapters/mysql_adapter.rb | 4 |
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) |