-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3f69b35
commit a83db9d
Showing
2 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# create_table メソッドで 'ROW_FORMAT=DYNAMIC' が | ||
# デフォルトで指定されるようにする | ||
# @see http://qiita.com/kamipo/items/101aaf8159cf1470d823 | ||
ActiveSupport.on_load :active_record do | ||
module ActiveRecord::ConnectionAdapters | ||
class AbstractMysqlAdapter | ||
def create_table_with_innodb_row_format(table_name, options = {}) | ||
table_options = options.merge(:options => 'ENGINE=InnoDB ROW_FORMAT=DYNAMIC') | ||
create_table_without_innodb_row_format(table_name, table_options) do |td| | ||
yield td if block_given? | ||
end | ||
end | ||
alias_method_chain :create_table, :innodb_row_format | ||
end | ||
end | ||
end |