Skip to content

Commit 4dcf229

Browse files
committed
remove duplicate and unused tags
1 parent 7f642ec commit 4dcf229

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class TagAatoCleanup < ActiveRecord::Migration
2+
def up
3+
ActsAsTaggableOn::Tag.delete_all(taggings_count: 0)
4+
ActsAsTaggableOn::Tag.destroy_all(name: '')
5+
ActsAsTaggableOn::Tag.destroy_all(name: %w(navarro etagwerker mattvvhat Assembly angels capital combinations turbulenz semerda))
6+
remove_index! 'tags', 'index_tags_on_name'
7+
add_index 'tags', ['name'], name: 'index_tags_on_name', unique: true
8+
end
9+
10+
def down
11+
raise ActiveRecord::IrreversibleMigration
12+
end
13+
end

db/schema.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#
1212
# It's strongly recommended to check this file into your version control system.
1313

14-
ActiveRecord::Schema.define(:version => 20141231203425) do
14+
ActiveRecord::Schema.define(:version => 20150103105333) do
1515

1616
add_extension "citext"
1717
add_extension "hstore"

0 commit comments

Comments
 (0)