module SQL::Mysql
Public Instance Methods
change_column_type_statement(name, column)
click to toggle source
# File lib/dm-migrations/sql/mysql.rb, line 40 def change_column_type_statement(name, column) "ALTER TABLE #{quote_name(name)} MODIFY COLUMN #{column.to_sql}" end
property_schema_statement(connection, schema)
click to toggle source
Calls superclass method
# File lib/dm-migrations/sql/mysql.rb, line 32 def property_schema_statement(connection, schema) if supports_serial? && schema[:serial] statement = "#{schema[:quote_column_name]} SERIAL PRIMARY KEY" else super end end
recreate_database()
click to toggle source
# File lib/dm-migrations/sql/mysql.rb, line 14 def recreate_database execute "DROP DATABASE #{schema_name}" execute "CREATE DATABASE #{schema_name}" execute "USE #{schema_name}" end
supports_schema_transactions?()
click to toggle source
# File lib/dm-migrations/sql/mysql.rb, line 6 def supports_schema_transactions? false end
supports_serial?()
click to toggle source
# File lib/dm-migrations/sql/mysql.rb, line 20 def supports_serial? true end
table(table_name)
click to toggle source
# File lib/dm-migrations/sql/mysql.rb, line 10 def table(table_name) SQL::Mysql::Table.new(self, table_name) end
table_options(opts)
click to toggle source
# File lib/dm-migrations/sql/mysql.rb, line 24 def table_options(opts) opt_engine = opts[:storage_engine] || storage_engine opt_char_set = opts[:character_set] || character_set opt_collation = opts[:collation] || collation " ENGINE = #{opt_engine} CHARACTER SET #{opt_char_set} COLLATE #{opt_collation}" end