Class: TagSetup

Inherits:
Sequel::Migration show all
Defined in:
lib/story_teller/inform/relational/tag.rb

Overview

The TagSetup class

Instance Method Summary collapse

Methods inherited from Sequel::Migration

down, table_exists?, up

Instance Method Details

#downObject



41
42
43
# File 'lib/story_teller/inform/relational/tag.rb', line 41

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

#upObject



27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/story_teller/inform/relational/tag.rb', line 27

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