Class: HTM::Migration
- Inherits:
-
Object
- Object
- HTM::Migration
- Defined in:
- lib/htm/migration.rb
Overview
Base class for Sequel migrations
Provides a simple interface for writing migrations compatible with HTM’s migration runner.
Instance Attribute Summary collapse
-
#db ⇒ Object
readonly
Returns the value of attribute db.
Instance Method Summary collapse
-
#down ⇒ Object
Override in subclass (optional for irreversible migrations).
-
#initialize(db) ⇒ Migration
constructor
A new instance of Migration.
-
#up ⇒ Object
Override in subclass.
Constructor Details
#initialize(db) ⇒ Migration
Returns a new instance of Migration.
27 28 29 |
# File 'lib/htm/migration.rb', line 27 def initialize(db) @db = db end |
Instance Attribute Details
#db ⇒ Object (readonly)
Returns the value of attribute db.
25 26 27 |
# File 'lib/htm/migration.rb', line 25 def db @db end |
Instance Method Details
#down ⇒ Object
Override in subclass (optional for irreversible migrations)
37 38 39 |
# File 'lib/htm/migration.rb', line 37 def down raise NotImplementedError, "#{self.class}#down must be implemented" end |
#up ⇒ Object
Override in subclass
32 33 34 |
# File 'lib/htm/migration.rb', line 32 def up raise NotImplementedError, "#{self.class}#up must be implemented" end |