Class: CreateTaggings

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/db/migrate/20091227004351_create_taggings.rb

Class Method Summary collapse

Class Method Details

.downObject



14
15
16
17
18
19
# File 'lib/db/migrate/20091227004351_create_taggings.rb', line 14

def self.down
  remove_index :taggings, :article_id
  remove_index :taggings, :tag_id
  
  drop_table :taggings
end

.upObject



2
3
4
5
6
7
8
9
10
11
12
# File 'lib/db/migrate/20091227004351_create_taggings.rb', line 2

def self.up
  create_table :taggings do |t|
    t.integer :article_id
    t.integer :tag_id
    
    t.timestamps
  end
  
  add_index :taggings, :article_id
  add_index :taggings, :tag_id
end