Class: CreateVitrageOwnersPiecesSlots

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/vitrage/templates/migrations/create_vitrage_slots.rb

Class Method Summary collapse

Class Method Details

.downObject



13
14
15
# File 'lib/generators/vitrage/templates/migrations/create_vitrage_slots.rb', line 13

def self.down
  drop_table :vitrage_owners_pieces_slots
end

.upObject



2
3
4
5
6
7
8
9
10
11
# File 'lib/generators/vitrage/templates/migrations/create_vitrage_slots.rb', line 2

def self.up
  create_table :vitrage_owners_pieces_slots do |t|
    t.references :owner, polymorphic: true, null: false, index: true
    t.references :piece, polymorphic: true,              index: true
    t.integer    :ordn,  default: 9,        null: false
    t.timestamps
  end

  add_index :vitrage_owners_pieces_slots, :ordn
end