Class: SequelData::Migrate::Migration

Inherits:
Object
  • Object
show all
Defined in:
lib/sequel_data/migrate/migration.rb

Constant Summary collapse

VALID_DIRECTION =
i[up down].freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.descendantsObject

Returns the list of Migration descendants.



9
10
11
# File 'lib/sequel_data/migrate/migration.rb', line 9

def self.descendants
  @descendants ||= []
end

.inherited(base) ⇒ Object

Adds the new migration class to the list of Migration descendants.



14
15
16
17
# File 'lib/sequel_data/migrate/migration.rb', line 14

def self.inherited(base)
  descendants << base
  super
end

Instance Method Details

#downObject

Raises:



23
24
25
# File 'lib/sequel_data/migrate/migration.rb', line 23

def down
  raise MigrationError, "No down method defined for migration #{self.class}"
end

#upObject

Raises:



19
20
21
# File 'lib/sequel_data/migrate/migration.rb', line 19

def up
  raise MigrationError, "No up method defined for migration #{self.class}"
end