Class: Lotus::Model::Migrator::SQLiteAdapter Private
- Defined in:
- lib/lotus/model/migrator/sqlite_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.
SQLite3 Migrator
Defined Under Namespace
Modules: Memory
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
-
#initialize(connection) ⇒ SQLiteAdapter
constructor
private
Initialize adapter.
- #load ⇒ Object private
Methods inherited from Adapter
Constructor Details
#initialize(connection) ⇒ SQLiteAdapter
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.
Initialize adapter
31 32 33 34 |
# File 'lib/lotus/model/migrator/sqlite_adapter.rb', line 31 def initialize(connection) super extend Memory if memory? end |
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.
38 39 40 41 42 43 |
# File 'lib/lotus/model/migrator/sqlite_adapter.rb', line 38 def create path.dirname.mkpath FileUtils.touch(path) rescue Errno::EACCES, Errno::EPERM raise MigrationError.new("Permission denied: #{ path.sub(/\A\/\//, '') }") 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.
47 48 49 50 51 |
# File 'lib/lotus/model/migrator/sqlite_adapter.rb', line 47 def drop path.delete rescue Errno::ENOENT raise MigrationError.new("Cannot find database: #{ path.sub(/\A\/\//, '') }") 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.
55 56 57 58 |
# File 'lib/lotus/model/migrator/sqlite_adapter.rb', line 55 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.
62 63 64 |
# File 'lib/lotus/model/migrator/sqlite_adapter.rb', line 62 def load load_structure end |