aboutsummaryrefslogtreecommitdiffstats
path: root/db/migrate/20110803223524_acts_as_taggable_on_migration.rb
diff options
context:
space:
mode:
authorPhilip Arndt <parndt@gmail.com>2012-11-29 08:17:09 +1300
committerPhilip Arndt <parndt@gmail.com>2012-11-29 08:17:24 +1300
commit3442aeb85087df97d36673ad846a434412e5baea (patch)
tree5df9d55d203f9b258d6e6e2ef0d7fb632097820c /db/migrate/20110803223524_acts_as_taggable_on_migration.rb
parentf7458c3cc6d00b67f597a580f3edd0dbd3b534fe (diff)
parentf906ef024ee39c31148edb49c6511f007735ce5a (diff)
downloadrefinerycms-blog-3442aeb85087df97d36673ad846a434412e5baea.tar.gz
refinerycms-blog-3442aeb85087df97d36673ad846a434412e5baea.tar.bz2
refinerycms-blog-3442aeb85087df97d36673ad846a434412e5baea.zip
Merge remote-tracking branch 'origin/squash_migrations'
Fixes #294
Diffstat (limited to 'db/migrate/20110803223524_acts_as_taggable_on_migration.rb')
-rw-r--r--db/migrate/20110803223524_acts_as_taggable_on_migration.rb26
1 files changed, 14 insertions, 12 deletions
diff --git a/db/migrate/20110803223524_acts_as_taggable_on_migration.rb b/db/migrate/20110803223524_acts_as_taggable_on_migration.rb
index 812daf4..49a6ca2 100644
--- a/db/migrate/20110803223524_acts_as_taggable_on_migration.rb
+++ b/db/migrate/20110803223524_acts_as_taggable_on_migration.rb
@@ -2,23 +2,25 @@ class ActsAsTaggableOnMigration < ActiveRecord::Migration
def up
create_table :tags do |t|
t.string :name
- end
+ end unless table_exists?(:tags)
- create_table :taggings do |t|
- t.references :tag
+ unless table_exists?(:taggings)
+ create_table :taggings do |t|
+ t.references :tag
- # 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
+ # 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.string :context
+ t.string :context
- t.datetime :created_at
- end
+ t.datetime :created_at
+ end
- add_index :taggings, :tag_id
- add_index :taggings, [:taggable_id, :taggable_type, :context]
+ add_index :taggings, :tag_id
+ add_index :taggings, [:taggable_id, :taggable_type, :context]
+ end
end
def down