Class: Lotus::Model::Migrator::MySQLAdapter Private
- Defined in:
- lib/lotus/model/migrator/mysql_adapter.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
MySQL adapter
Constant Summary
Constants inherited from Adapter
Adapter::MIGRATIONS_TABLE, Adapter::MIGRATIONS_TABLE_VERSION_COLUMN
Instance Method Summary collapse
- #create ⇒ Object private
- #drop ⇒ Object private
- #dump ⇒ Object private
- #load ⇒ Object private
Methods inherited from Adapter
Constructor Details
This class inherits a constructor from Lotus::Model::Migrator::Adapter
Instance Method Details
#create ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
11 12 13 |
# File 'lib/lotus/model/migrator/mysql_adapter.rb', line 11 def create new_connection(global: true).run %(CREATE DATABASE #{ database };) end |
#drop ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/lotus/model/migrator/mysql_adapter.rb', line 17 def drop new_connection(global: true).run %(DROP DATABASE #{ database };) rescue Sequel::DatabaseError => e = if e..match(/doesn\'t exist/) "Cannot find database: #{ database }" else e. end raise MigrationError.new() end |
#dump ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
31 32 33 34 |
# File 'lib/lotus/model/migrator/mysql_adapter.rb', line 31 def dump dump_structure dump_migrations_data end |
#load ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
38 39 40 |
# File 'lib/lotus/model/migrator/mysql_adapter.rb', line 38 def load load_structure end |