Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stammy/103236 to your computer and use it in GitHub Desktop.
Save stammy/103236 to your computer and use it in GitHub Desktop.
class ActsAsTaggableOnMigration < ActiveRecord::Migration
def self.up
change_table :taggings do |t|
t.column :tagger_id, :integer
t.column :tagger_type, :string
t.column :context, :string
end
add_index :taggings, :context
end
def self.down
remove_column :taggings, :context
remove_column :taggings, :tagger_id
remove_column :taggings, :tagger_type
remove_index :taggings, :context
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment