From 88a34849c415688846659a350d634d9ac566024f Mon Sep 17 00:00:00 2001 From: hukl Date: Sun, 16 Aug 2009 00:38:27 +0200 Subject: consolidated migration --- .../20090815220058_migrate_tagging_tables.rb | 29 ++++++++-------------- 1 file changed, 10 insertions(+), 19 deletions(-) (limited to 'db/migrate') diff --git a/db/migrate/20090815220058_migrate_tagging_tables.rb b/db/migrate/20090815220058_migrate_tagging_tables.rb index 59e054f8..e28a16e3 100644 --- a/db/migrate/20090815220058_migrate_tagging_tables.rb +++ b/db/migrate/20090815220058_migrate_tagging_tables.rb @@ -3,27 +3,18 @@ class MigrateTaggingTables < ActiveRecord::Migration add_column :tags, :taggings_count, :integer, :default => 0, :null => false add_column :taggings, :user_id, :integer - add_index :tags, :name - add_index :tags, :taggings_count - - Find objects for a tag - add_index :taggings, [:user_id, :tag_id, :taggable_type] - - Find tags for an object - add_index :taggings, [:user_id, :taggable_id, :taggable_type] + add_index :tags, :name + add_index :tags, :taggings_count + add_index :taggings, [:user_id, :tag_id, :taggable_type] + add_index :taggings, [:user_id, :taggable_id, :taggable_type] end def self.down - remove_column :tags, :taggings_count - remove_column :taggings, :user_id - - remove_index :tags, :name - remove_index :tags, :taggings_count - - # Find objects for a tag - remove_index :taggings, [:user_id, :tag_id, :taggable_type] - - # Find tags for an object - remove_index :taggings, [:user_id, :taggable_id, :taggable_type] + remove_column :tags, :taggings_count + remove_column :taggings, :user_id + remove_index :tags, :name + remove_index :tags, :taggings_count + remove_index :taggings, [:user_id, :tag_id, :taggable_type] + remove_index :taggings, [:user_id, :taggable_id, :taggable_type] end end -- cgit v1.3