uploads: make upload_media_assets.media_asset_id nullable.

Make upload_media_assets.media_asset_id nullable in order to support
multi-file uploads. The media asset will be null while the image is
still being downloaded from the source.
This commit is contained in:
evazion
2022-02-10 14:09:15 -06:00
parent 70d38d9e0b
commit c2ed5c2841
3 changed files with 9 additions and 3 deletions

View File

@@ -0,0 +1,5 @@
class SetMediaAssetToNullableOnUploadMediaAssets < ActiveRecord::Migration[7.0]
def change
change_column_null :upload_media_assets, :media_asset_id, true
end
end

View File

@@ -1915,7 +1915,7 @@ CREATE TABLE public.upload_media_assets (
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL,
upload_id bigint NOT NULL,
media_asset_id bigint NOT NULL,
media_asset_id bigint,
status integer DEFAULT 0 NOT NULL,
source_url character varying DEFAULT ''::character varying NOT NULL,
error character varying
@@ -5776,6 +5776,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('20220203040648'),
('20220204075610'),
('20220207195123'),
('20220210171310');
('20220210171310'),
('20220210200157');