From 49c38f208b8a05cee49400ffababc49dfc431daa Mon Sep 17 00:00:00 2001 From: Philip Arndt Date: Sun, 14 Jul 2013 04:37:18 +1200 Subject: Revert f906ef0 but maintain table name improvements --- ...20110803223524_acts_as_taggable_on_migration.rb | 26 ++++++++++------------ 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'db/migrate/20110803223524_acts_as_taggable_on_migration.rb') diff --git a/db/migrate/20110803223524_acts_as_taggable_on_migration.rb b/db/migrate/20110803223524_acts_as_taggable_on_migration.rb index 49a6ca2..812daf4 100644 --- a/db/migrate/20110803223524_acts_as_taggable_on_migration.rb +++ b/db/migrate/20110803223524_acts_as_taggable_on_migration.rb @@ -2,25 +2,23 @@ class ActsAsTaggableOnMigration < ActiveRecord::Migration def up create_table :tags do |t| t.string :name - end unless table_exists?(:tags) - - unless table_exists?(:taggings) - create_table :taggings do |t| - t.references :tag + end - # You should make sure that the column created is - # long enough to store the required class names. - t.references :taggable, :polymorphic => true - t.references :tagger, :polymorphic => true + create_table :taggings do |t| + t.references :tag - t.string :context + # You should make sure that the column created is + # long enough to store the required class names. + t.references :taggable, :polymorphic => true + t.references :tagger, :polymorphic => true - t.datetime :created_at - end + t.string :context - add_index :taggings, :tag_id - add_index :taggings, [:taggable_id, :taggable_type, :context] + t.datetime :created_at end + + add_index :taggings, :tag_id + add_index :taggings, [:taggable_id, :taggable_type, :context] end def down -- cgit v1.2.3