Class: SandthornDriverSequel2::Migration

Inherits:
Object
  • Object
show all
Includes:
EventStoreContext
Defined in:
lib/sandthorn_driver_sequel_2/migration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from EventStoreContext

#events_table_name, #snapshots_table_name, #with_context_if_exists

Constructor Details

#initialize(url: nil, context: nil) ⇒ Migration

Returns a new instance of Migration.



6
7
8
9
# File 'lib/sandthorn_driver_sequel_2/migration.rb', line 6

def initialize url: nil, context: nil
  @driver = SequelDriver.new url: url
  @context = context
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



5
6
7
# File 'lib/sandthorn_driver_sequel_2/migration.rb', line 5

def context
  @context
end

#driverObject (readonly)

Returns the value of attribute driver.



5
6
7
# File 'lib/sandthorn_driver_sequel_2/migration.rb', line 5

def driver
  @driver
end

Instance Method Details

#migrate!Object



10
11
12
13
14
# File 'lib/sandthorn_driver_sequel_2/migration.rb', line 10

def migrate!
  ensure_migration_table!
  events
  snapshots
end