Class: TagSetup

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

Overview

The TagSetup class

Instance Method Summary collapse

Methods inherited from Sequel::Migration

down, table_exists?, up

Instance Method Details

#downObject



40
41
42
# File 'lib/runtime/tag.rb', line 40

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

#upObject



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

def up
  # return if table_exists? :tag
  log.debug "#up"
  create_table? :tag do
    primary_key :id
    index :name
    index :created_at

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