Module: SQL::Mysql
- Defined in:
- lib/gems/dm-migrations-0.9.9/lib/sql/mysql.rb
Defined Under Namespace
Instance Method Summary collapse
-
#property_schema_statement(schema) ⇒ Object
TODO: move to dm-more/dm-migrations.
- #recreate_database ⇒ Object
- #supports_schema_transactions? ⇒ Boolean
- #supports_serial? ⇒ Boolean
- #table(table_name) ⇒ Object
Instance Method Details
#property_schema_statement(schema) ⇒ Object
TODO: move to dm-more/dm-migrations
25 26 27 28 29 30 31 |
# File 'lib/gems/dm-migrations-0.9.9/lib/sql/mysql.rb', line 25 def property_schema_statement(schema) if supports_serial? && schema[:serial] statement = "#{schema[:quote_column_name]} serial PRIMARY KEY" else super end end |
#recreate_database ⇒ Object
14 15 16 17 18 |
# File 'lib/gems/dm-migrations-0.9.9/lib/sql/mysql.rb', line 14 def recreate_database execute "DROP DATABASE #{db_name}" execute "CREATE DATABASE #{db_name}" execute "USE #{db_name}" end |
#supports_schema_transactions? ⇒ Boolean
6 7 8 |
# File 'lib/gems/dm-migrations-0.9.9/lib/sql/mysql.rb', line 6 def supports_schema_transactions? false end |
#supports_serial? ⇒ Boolean
20 21 22 |
# File 'lib/gems/dm-migrations-0.9.9/lib/sql/mysql.rb', line 20 def supports_serial? true end |