Skip to content

Commit fb21f7c

Browse files
committed
Add a table to immutably store the verified email of the version publisher
The publisher's email address is deliberatel copied into this table rather than referencing the users table. If people delete their account, remove their email, etc we still have a way to attempt to contact the publisher of a particular version in the event of a DMCA complaint.
1 parent 62fdb18 commit fb21f7c

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DROP TABLE versions_published_by;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
CREATE TABLE versions_published_by (
2+
version_id INTEGER NOT NULL PRIMARY KEY REFERENCES versions(id) ON DELETE CASCADE,
3+
email VARCHAR NOT NULL
4+
);

src/schema.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -912,6 +912,30 @@ table! {
912912
}
913913
}
914914

915+
table! {
916+
use diesel::sql_types::*;
917+
use diesel_full_text_search::{TsVector as Tsvector};
918+
use diesel_ltree::Ltree;
919+
920+
/// Representation of the `versions_published_by` table.
921+
///
922+
/// (Automatically generated by Diesel.)
923+
versions_published_by (version_id) {
924+
/// The `version_id` column of the `versions_published_by` table.
925+
///
926+
/// Its SQL type is `Int4`.
927+
///
928+
/// (Automatically generated by Diesel.)
929+
version_id -> Int4,
930+
/// The `email` column of the `versions_published_by` table.
931+
///
932+
/// Its SQL type is `Varchar`.
933+
///
934+
/// (Automatically generated by Diesel.)
935+
email -> Varchar,
936+
}
937+
}
938+
915939
joinable!(api_tokens -> users (user_id));
916940
joinable!(crate_downloads -> crates (crate_id));
917941
joinable!(crate_owner_invitations -> crates (crate_id));
@@ -934,6 +958,7 @@ joinable!(version_authors -> versions (version_id));
934958
joinable!(version_downloads -> versions (version_id));
935959
joinable!(versions -> crates (crate_id));
936960
joinable!(versions -> users (published_by));
961+
joinable!(versions_published_by -> versions (version_id));
937962

938963
allow_tables_to_appear_in_same_query!(
939964
api_tokens,
@@ -958,4 +983,5 @@ allow_tables_to_appear_in_same_query!(
958983
version_authors,
959984
version_downloads,
960985
versions,
986+
versions_published_by,
961987
);

0 commit comments

Comments
 (0)