method

table_options

Importance_0
v5.0.0.1 - Show latest stable - 0 notes - Class: ActiveRecord::ConnectionAdapters
table_options(table_name) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb, line 545
      def table_options(table_name)
        create_table_info = create_table_info(table_name)

        # strip create_definitions and partition_options
        raw_table_options = create_table_info.sub(/\A.*\n\) /, '').sub(/\n\/\*!.*\*\/\n\z/, '').strip

        # strip AUTO_INCREMENT
        raw_table_options.sub!(/(ENGINE=\w+)(?: AUTO_INCREMENT=\d+)/, '\1')

        # strip COMMENT
        raw_table_options.sub!(/ COMMENT='.+'/, '')

        raw_table_options
      end
Register or log in to add new notes.