acts-as-taggable-onのバージョンを上げたらエラー

Shunsuke Sawada

タイトルの通り、acts-as-taggable-onをアップデートしたらエラーです。
直さねば…という内容。

これですね。
UPGRADING.md

1
rake acts_as_taggable_on_engine:install:migrations

で、

1
rake db:migrate

とすればOKなはずだったけど、migrateに失敗してしまった。
  

1
2
3
4
5
6
7
8
9
10
igrating to AddMissingUniqueIndices (20140521101625)
==  AddMissingUniqueIndices: migrating ========================================
-- add_index(:tags, :name, {:unique=>true})
PG::UniqueViolation: ERROR:  could not create unique index "index_tags_on_name"
DETAIL:  Key (name)=(アプリ) is duplicated.
: CREATE UNIQUE INDEX  "index_tags_on_name" ON "tags"  ("name")
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

だとさ。
データベースをチェックすると、「アプリ」というタグが2つあった。なぜ…。
理由は分からないけど、ひとまず「application」にして、やり過ごしました。

1
Shunsuke Sawada

おすすめの記事

ワーホリ最初の授業で「え...?」てならないための最低限の文法単語(超基本)
2
X-mini KAIはノマドワーカーの味方
SSL使う時javascriptの読み込みで気をつけるのはhttp://だけじゃなかった…と思ったけどそうじゃなかった。
1