uploads: add column for error messages.

Change it so uploads store errors in an `error` column instead of in the
`status` field.
This commit is contained in:
evazion
2022-02-07 14:41:48 -06:00
parent 19a9cf3d2f
commit 1a61e329ba
9 changed files with 45 additions and 21 deletions

View File

@@ -0,0 +1,6 @@
class AddErrorToUploads < ActiveRecord::Migration[7.0]
def change
add_column :uploads, :error, :text
add_index :uploads, :error, where: "error IS NOT NULL"
end
end

View File

@@ -1950,7 +1950,8 @@ CREATE TABLE public.uploads (
status text DEFAULT 'pending'::text NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
referer_url text
referer_url text,
error text
);
@@ -4534,6 +4535,13 @@ CREATE INDEX index_upload_media_assets_on_media_asset_id ON public.upload_media_
CREATE INDEX index_upload_media_assets_on_upload_id ON public.upload_media_assets USING btree (upload_id);
--
-- Name: index_uploads_on_error; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_uploads_on_error ON public.uploads USING btree (error) WHERE (error IS NOT NULL);
--
-- Name: index_uploads_on_referer_url; Type: INDEX; Schema: public; Owner: -
--
@@ -5741,6 +5749,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('20220120233850'),
('20220124195900'),
('20220203040648'),
('20220204075610');
('20220204075610'),
('20220207195123');