ugoiras: add md5 column to pixiv_ugoira_frame_data.

This is necessary so we can associate ugoira frame data with the media
asset instead of with the post.
This commit is contained in:
evazion
2021-10-18 00:08:17 -05:00
parent 1d034a3223
commit 85c3b4f2d1
2 changed files with 21 additions and 2 deletions

View File

@@ -0,0 +1,10 @@
class AddMd5ToPixivUgoiraFrameData < ActiveRecord::Migration[6.1]
def change
add_column :pixiv_ugoira_frame_data, :md5, :string, null: true, default: nil
add_index :pixiv_ugoira_frame_data, :md5, unique: true
up_only do
execute "UPDATE pixiv_ugoira_frame_data u SET md5 = p.md5 FROM posts p WHERE p.id = u.post_id"
end
end
end