Class: CreateCategorizations

Inherits:
Sequel::Migration show all
Defined in:
lib/migrations/003_create_categorizations.rb

Instance Method Summary collapse

Methods inherited from Sequel::Migration

apply, descendants, inherited, #initialize, #method_missing

Constructor Details

This class inherits a constructor from Sequel::Migration

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Sequel::Migration

Instance Method Details

#downObject


13
14
15
# File 'lib/migrations/003_create_categorizations.rb', line 13

def down
  drop_table(:categorizations)
end

#upObject


2
3
4
5
6
7
8
9
10
11
# File 'lib/migrations/003_create_categorizations.rb', line 2

def up
  create_table(:categorizations, :ignore_index_errors=>true) do
    primary_key :id
    Integer :racer_id, :null=>false
    Integer :category_id, :null=>false
    
    index [:category_id], :name=>:index_categorizations_category
    index [:racer_id], :name=>:index_categorizations_racer
  end
end