@@ -12,6 +12,25 @@ pub mod sql_types {
1212 pub struct Ltree ;
1313}
1414
15+ diesel:: table! {
16+ use diesel:: sql_types:: * ;
17+ use diesel_full_text_search:: Tsvector ;
18+
19+ /// Usernames previously associated with users
20+ abandoned_usernames ( id) {
21+ /// Date and time the user stopped using this username (due to name change, account deactivation, or similar)
22+ abandoned_at -> Timestamptz ,
23+ /// Date and time this username will be available to other users
24+ available_at -> Timestamptz ,
25+ /// Unique identifier of the `abandoned_usernames` row
26+ id -> Int8 ,
27+ /// The ID of the user who was using this username for this time period, or NULL if the user was deleted
28+ previous_user_id -> Nullable <Int4 >,
29+ /// The abandoned username in question (use `canon_username()` for normalization, if needed)
30+ username -> Varchar ,
31+ }
32+ }
33+
1534diesel:: table! {
1635 use diesel:: sql_types:: * ;
1736 use diesel_full_text_search:: Tsvector ;
@@ -768,6 +787,24 @@ diesel::table! {
768787 }
769788}
770789
790+ diesel:: table! {
791+ /// Representation of the `recent_crate_downloads` view.
792+ ///
793+ /// This data represents the downloads in the last 90 days.
794+ /// This view does not contain realtime data.
795+ /// It is refreshed by the `update-downloads` script.
796+ recent_crate_downloads ( crate_id) {
797+ /// The `crate_id` column of the `recent_crate_downloads` view.
798+ ///
799+ /// Its SQL type is `Integer`.
800+ crate_id -> Integer ,
801+ /// The `downloads` column of the `recent_crate_downloads` table.
802+ ///
803+ /// Its SQL type is `BigInt`.
804+ downloads -> BigInt ,
805+ }
806+ }
807+
771808diesel:: table! {
772809 use diesel:: sql_types:: * ;
773810 use diesel_full_text_search:: Tsvector ;
@@ -791,24 +828,6 @@ diesel::table! {
791828 }
792829}
793830
794- diesel:: table! {
795- /// Representation of the `recent_crate_downloads` view.
796- ///
797- /// This data represents the downloads in the last 90 days.
798- /// This view does not contain realtime data.
799- /// It is refreshed by the `update-downloads` script.
800- recent_crate_downloads ( crate_id) {
801- /// The `crate_id` column of the `recent_crate_downloads` view.
802- ///
803- /// Its SQL type is `Integer`.
804- crate_id -> Integer ,
805- /// The `downloads` column of the `recent_crate_downloads` table.
806- ///
807- /// Its SQL type is `BigInt`.
808- downloads -> BigInt ,
809- }
810- }
811-
812831diesel:: table! {
813832 use diesel:: sql_types:: * ;
814833 use diesel_full_text_search:: Tsvector ;
@@ -1274,6 +1293,7 @@ diesel::table! {
12741293 }
12751294}
12761295
1296+ diesel:: joinable!( abandoned_usernames -> users ( previous_user_id) ) ;
12771297diesel:: joinable!( api_tokens -> users ( user_id) ) ;
12781298diesel:: joinable!( crate_downloads -> crates ( crate_id) ) ;
12791299diesel:: joinable!( crate_owner_invitations -> crates ( crate_id) ) ;
@@ -1309,6 +1329,7 @@ diesel::joinable!(versions -> users (published_by));
13091329diesel:: joinable!( versions_published_by -> versions ( version_id) ) ;
13101330
13111331diesel:: allow_tables_to_appear_in_same_query!(
1332+ abandoned_usernames,
13121333 api_tokens,
13131334 background_jobs,
13141335 categories,
0 commit comments