-
-
Save ta1kt0me/fc350f3222df027f3572 to your computer and use it in GitHub Desktop.
It is forked from https://gist.github.com/keitaj/773c6ba89ffc722d60a5 . It changes ROW_FORMAT to COMPRESSED.
This file contains hidden or 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
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=COMPRESSED') | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment