Skip to content

Commit

Permalink
try1: fix update issue that led to all posts have to be touched once …
Browse files Browse the repository at this point in the history
…to work propperly
  • Loading branch information
rueckerl committed Dec 20, 2015
1 parent d1165da commit 196d564
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions db/migrate/20151220095617_update_tagging_tables.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ def up
# long enough to store the required class names.
# t.references :taggable, polymorphic: true
t.references :tagger, polymorphic: true
t.string :taggable_type, null: false, default: ''
t.string :taggable_type, null: false, default: 'Post'

# Limit is created to prevent MySQL error on index
# length for MyISAM table type: http://bit.ly/vgW2Ql
t.string :context, limit: 128
t.string :context, limit: 128, default: 'tags', null: false

#t.datetime :created_at
end
# set default before to force the db filling this field
change_column_default(:taggings, :taggable_type, nil)
change_column_default(:taggings, :context, nil)

if ActsAsTaggableOn::Utils.using_mysql?
execute("ALTER TABLE tags MODIFY name varchar(255) CHARACTER SET utf8 COLLATE utf8_bin;")
Expand Down

0 comments on commit 196d564

Please sign in to comment.