module Glueby::Generator::MigrateGenerator

Constants

MYSQL_ADAPTERS

Public Instance Methods

migration_version() click to toggle source
# File lib/glueby/generator/migrate_generator.rb, line 18
def migration_version
  major = ::Rails::VERSION::MAJOR
  if major >= 5
    "[#{major}.#{::Rails::VERSION::MINOR}]"
  end
end
mysql?() click to toggle source
# File lib/glueby/generator/migrate_generator.rb, line 25
def mysql?
  MYSQL_ADAPTERS.include?(::ActiveRecord::Base.connection.class.name)
end
table_options() click to toggle source
# File lib/glueby/generator/migrate_generator.rb, line 29
def table_options
  if mysql?
    ', :options => "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci"'
  else
    ""
  end
end