Class: ModularizedSetup

Inherits:
Sequel::Migration show all
Defined in:
lib/runtime/module.rb

Overview

The ModularizedSetup class

Instance Method Summary collapse

Methods inherited from Sequel::Migration

down, table_exists?, up

Instance Method Details

#downObject



113
114
115
# File 'lib/runtime/module.rb', line 113

def down
  drop_table(:modularized, cascade: true) if table_exists? :modularized
end

#upObject



105
106
107
108
109
110
111
# File 'lib/runtime/module.rb', line 105

def up
  create_table? :modularized do
    primary_key :id
    foreign_key :object_id, :object, on_delete: :cascade
    foreign_key :module_id, :module, on_delete: :cascade
  end
end