diff --git a/_sql/migrations/2023-04-23-112622_media_uploads_alterations/down.sql b/_sql/migrations/2023-04-23-112622_media_uploads_alterations/down.sql new file mode 100644 index 0000000000..731e0fe64a --- /dev/null +++ b/_sql/migrations/2023-04-23-112622_media_uploads_alterations/down.sql @@ -0,0 +1,10 @@ +-- noinspection SqlDialectInspectionForFile +-- noinspection SqlNoDataSourceInspectionForFile +-- noinspection SqlResolveForFile + +ALTER TABLE media_uploads + ADD COLUMN public_bucket_directory_full_path VARCHAR(255) NOT NULL + AFTER public_bucket_directory_hash; + +ALTER TABLE media_uploads + RENAME COLUMN maybe_extra_file_modification_info TO extra_file_modification_info ; diff --git a/_sql/migrations/2023-04-23-112622_media_uploads_alterations/up.sql b/_sql/migrations/2023-04-23-112622_media_uploads_alterations/up.sql new file mode 100644 index 0000000000..0ae31b280b --- /dev/null +++ b/_sql/migrations/2023-04-23-112622_media_uploads_alterations/up.sql @@ -0,0 +1,8 @@ +-- noinspection SqlDialectInspectionForFile +-- noinspection SqlNoDataSourceInspectionForFile +-- noinspection SqlResolveForFile + +ALTER TABLE media_uploads DROP COLUMN public_bucket_directory_full_path; + +ALTER TABLE media_uploads + RENAME COLUMN extra_file_modification_info TO maybe_extra_file_modification_info; diff --git a/_sql/migrations_squashed/media_uploads.sql b/_sql/migrations_squashed/media_uploads.sql index c5c8b50d61..4d45a46bd5 100644 --- a/_sql/migrations_squashed/media_uploads.sql +++ b/_sql/migrations_squashed/media_uploads.sql @@ -64,17 +64,10 @@ CREATE TABLE media_uploads ( -- as well as any transcodings, downsamplings, etc. public_bucket_directory_hash VARCHAR(32) NOT NULL, - -- TODO(bt, 2022-12-20): Before landing, rename this field be better and indicate this - -- is a *directory*. Add a second field to contain the default file name. - -- The directory this media is uploaded to will be exclusive for this file. - -- Only this given record will live in this bucket, but the directory may include - -- other transcodings or truncations. - public_bucket_directory_full_path VARCHAR(255) NOT NULL, - -- We'll likely transcode (and potentially truncate) most media given to us. -- This will store a json-encoded struct that details the changes. -- TEXT = 65,535 bytes (64 KiB), ~= 4 bytes per UTF-8 character, ~ 16383 characters. - extra_file_modification_info TEXT DEFAULT NULL, + maybe_extra_file_modification_info TEXT DEFAULT NULL, -- ========== CREATOR DETAILS AND PREFERENCES ==========