From c9d832b446d528a32db4a2e8e59e4be5e2e35759 Mon Sep 17 00:00:00 2001 From: hi-rustin <29879298+hi-rustin@users.noreply.github.com> Date: Sat, 17 Aug 2024 23:36:02 +0800 Subject: [PATCH] Add yank message migration --- migrations/2024-08-17-152408_add-yank-message/down.sql | 1 + migrations/2024-08-17-152408_add-yank-message/up.sql | 3 +++ src/models/version.rs | 1 + src/schema.rs | 3 +++ 4 files changed, 8 insertions(+) create mode 100644 migrations/2024-08-17-152408_add-yank-message/down.sql create mode 100644 migrations/2024-08-17-152408_add-yank-message/up.sql diff --git a/migrations/2024-08-17-152408_add-yank-message/down.sql b/migrations/2024-08-17-152408_add-yank-message/down.sql new file mode 100644 index 00000000000..3240cac6b83 --- /dev/null +++ b/migrations/2024-08-17-152408_add-yank-message/down.sql @@ -0,0 +1 @@ +ALTER TABLE versions DROP yank_message; diff --git a/migrations/2024-08-17-152408_add-yank-message/up.sql b/migrations/2024-08-17-152408_add-yank-message/up.sql new file mode 100644 index 00000000000..b6f28f492a4 --- /dev/null +++ b/migrations/2024-08-17-152408_add-yank-message/up.sql @@ -0,0 +1,3 @@ +ALTER TABLE versions ADD COLUMN yank_message VARCHAR(255); + +COMMENT ON COLUMN versions.yank_message IS 'message associated with a yanked version'; diff --git a/src/models/version.rs b/src/models/version.rs index 4966ad724ec..3761e701316 100644 --- a/src/models/version.rs +++ b/src/models/version.rs @@ -31,6 +31,7 @@ pub struct Version { pub rust_version: Option, pub has_lib: Option, pub bin_names: Option>>, + pub yank_message: Option, } impl Version { diff --git a/src/schema.rs b/src/schema.rs index 8ef596e23b5..2078c84dcd3 100644 --- a/src/schema.rs +++ b/src/schema.rs @@ -985,6 +985,9 @@ diesel::table! { has_lib -> Nullable, /// list of the names of all detected binaries in the version. the list may be empty which indicates that no binaries were detected in the version. the column may be NULL is the version has not been analyzed yet. bin_names -> Nullable>>, + /// message associated with a yanked version + #[max_length = 255] + yank_message -> Nullable, } }