1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Made migrations create InnoDB tables per default

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1168 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson 2005-04-16 06:38:12 +00:00
parent 9dd8d3d3e4
commit 0baf344457
2 changed files with 6 additions and 2 deletions

View file

@ -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

View file

@ -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)