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
|
||||||
@@ -1329,7 +1329,8 @@ CREATE TABLE public.pixiv_ugoira_frame_data (
|
|||||||
id integer NOT NULL,
|
id integer NOT NULL,
|
||||||
post_id integer NOT NULL,
|
post_id integer NOT NULL,
|
||||||
data text NOT NULL,
|
data text NOT NULL,
|
||||||
content_type character varying NOT NULL
|
content_type character varying NOT NULL,
|
||||||
|
md5 character varying
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@@ -3897,6 +3898,13 @@ CREATE INDEX index_notes_on_body_tsvector ON public.notes USING gin (to_tsvector
|
|||||||
CREATE INDEX index_notes_on_post_id ON public.notes USING btree (post_id);
|
CREATE INDEX index_notes_on_post_id ON public.notes USING btree (post_id);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: index_pixiv_ugoira_frame_data_on_md5; Type: INDEX; Schema: public; Owner: -
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE UNIQUE INDEX index_pixiv_ugoira_frame_data_on_md5 ON public.pixiv_ugoira_frame_data USING btree (md5);
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Name: index_pixiv_ugoira_frame_data_on_post_id; Type: INDEX; Schema: public; Owner: -
|
-- Name: index_pixiv_ugoira_frame_data_on_post_id; Type: INDEX; Schema: public; Owner: -
|
||||||
--
|
--
|
||||||
@@ -5039,6 +5047,7 @@ INSERT INTO "schema_migrations" (version) VALUES
|
|||||||
('20211011044400'),
|
('20211011044400'),
|
||||||
('20211013011619'),
|
('20211013011619'),
|
||||||
('20211014063943'),
|
('20211014063943'),
|
||||||
('20211015223510');
|
('20211015223510'),
|
||||||
|
('20211018045429');
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user