uploads: add upload_media_assets.page_url.
This is needed for multi-file uploads. We need to know both the image url and the page url to set the post's source correctly when converting an upload media asset into a post.
This commit is contained in:
@@ -12,7 +12,7 @@ class UploadMediaAsset < ApplicationRecord
|
||||
}
|
||||
|
||||
def self.search(params)
|
||||
q = search_attributes(params, :id, :created_at, :updated_at, :status, :source_url, :error, :upload, :media_asset)
|
||||
q = search_attributes(params, :id, :created_at, :updated_at, :status, :source_url, :page_url, :error, :upload, :media_asset)
|
||||
q.apply_default_order(params)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddPageUrlToUploadMediaAssets < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
add_column :upload_media_assets, :page_url, :string, null: true
|
||||
end
|
||||
end
|
||||
@@ -1918,7 +1918,8 @@ CREATE TABLE public.upload_media_assets (
|
||||
media_asset_id bigint,
|
||||
status integer DEFAULT 0 NOT NULL,
|
||||
source_url character varying DEFAULT ''::character varying NOT NULL,
|
||||
error character varying
|
||||
error character varying,
|
||||
page_url character varying
|
||||
);
|
||||
|
||||
|
||||
@@ -5777,6 +5778,7 @@ INSERT INTO "schema_migrations" (version) VALUES
|
||||
('20220204075610'),
|
||||
('20220207195123'),
|
||||
('20220210171310'),
|
||||
('20220210200157');
|
||||
('20220210200157'),
|
||||
('20220211075129');
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user