14

I have upgraded my rails version of one my app to 4.1.0. While upgrading I have upgraded all gems from Gemfile, which upgraded acts-as-taggable-on to 3.1.1 too.

but after upgrade, when I tried to add tags on respective object, it is failing with following error.

  post = Post.last
  post.tag_list = "development"
  post.save

ERROR: column "taggings_count" does not exist

details error is here:

SQL (0.9ms)  UPDATE "tags" SET "taggings_count" = COALESCE("taggings_count", 0) - 1 WHERE "tags"."id" = 3146
PG::UndefinedColumn: ERROR:  column "taggings_count" does not exist
LINE 1: UPDATE "tags" SET "taggings_count" = COALESCE("taggings_coun...
                                                      ^
: UPDATE "tags" SET "taggings_count" = COALESCE("taggings_count", 0) - 1 WHERE "tags"."id" = 3146
   (0.3ms)  ROLLBACK
ActiveRecord::StatementInvalid: PG::UndefinedColumn: ERROR:  column "taggings_count" does not exist
LINE 1: UPDATE "tags" SET "taggings_count" = COALESCE("taggings_coun...
                                                      ^
: UPDATE "tags" SET "taggings_count" = COALESCE("taggings_count", 0) - 1 WHERE "tags"."id" = 3146

1 Answer 1

29

just we have to do,

rake acts_as_taggable_on_engine:install:migrations

Since acts-as-taggable-on has added new migrations.

2
  • I got a problem on Duplicate entry ... for key 'index_tags_on_name': CREATE UNIQUE INDEX index_tags_on_name ON tags (name). don't know if there is something to understand right here
    – Ben
    Nov 5, 2014 at 16:56
  • In the first migration this generates, remove the first line creating the index_tags_on_name (I'd copy/paste, but I already removed it).
    – soychicka
    Mar 27, 2015 at 15:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.