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:
@@ -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
|
||||
Reference in New Issue
Block a user