Class: ModuleSetup

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

Overview

The ModuleSetup class

Instance Method Summary collapse

Methods inherited from Sequel::Migration

down, table_exists?, up

Instance Method Details

#downObject



39
40
41
# File 'lib/runtime/module.rb', line 39

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

#upObject



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/runtime/module.rb', line 26

def up
  log.debug "#up"
  create_table? :module do
    primary_key :id
    index :name
    index :created_at

    String :name, unique: true, null: false
    DateTime :created_at
    DateTime :modified_at
  end
end