Class: Hanami::Model::Migrator::SQLiteAdapter Private
- Defined in:
- lib/hanami/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(configuration) ⇒ SQLiteAdapter
constructor
private
Initialize adapter.
- #load ⇒ Object private
Methods inherited from Adapter
for, #migrate, #rollback, #version
Constructor Details
#initialize(configuration) ⇒ 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
35 36 37 38 |
# File 'lib/hanami/model/migrator/sqlite_adapter.rb', line 35 def initialize(configuration) 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.
42 43 44 45 46 47 |
# File 'lib/hanami/model/migrator/sqlite_adapter.rb', line 42 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.
51 52 53 54 55 |
# File 'lib/hanami/model/migrator/sqlite_adapter.rb', line 51 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.
59 60 61 62 |
# File 'lib/hanami/model/migrator/sqlite_adapter.rb', line 59 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.
66 67 68 |
# File 'lib/hanami/model/migrator/sqlite_adapter.rb', line 66 def load load_structure end |