Skip to content

Commit 1a0b34e

Browse files
committed
Fix some schema changes that were missed
The schema.patch file is updated to rollback the new `Nullable` in `Array<Nullable<_>>`: * api_tokens.crate_scopes * api_tokens.endpoint_scopes * dependencies.features I've confirmed there there are no existing null values in any of these arrays in the production database.
1 parent 8dedc45 commit 1a0b34e

File tree

3 files changed

+136
-156
lines changed

3 files changed

+136
-156
lines changed

diesel.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@
33
[print_schema]
44
file = "src/schema.rs"
55
with_docs = true
6-
import_types = ["diesel::sql_types::*", "diesel_full_text_search::{TsVector as Tsvector}"]
76
patch_file = "src/schema.patch"

src/schema.patch

Lines changed: 62 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,35 @@
11
diff --git a/src/schema.rs b/src/schema.rs
2-
index 27d068510..f2a8546aa 100644
2+
index 80d3baaf0..c39c711e2 100644
33
--- a/src/schema.rs
44
+++ b/src/schema.rs
5-
@@ -1,3 +1,5 @@
6-
+#![allow(unused_imports)]
7-
+
8-
table! {
9-
use diesel::sql_types::*;
10-
use diesel_full_text_search::{TsVector as Tsvector};
11-
@@ -183,12 +185,6 @@ table! {
5+
@@ -14,9 +14,7 @@ pub mod sql_types {
6+
/// The `pg_catalog.tsvector` SQL type
7+
///
8+
/// (Automatically generated by Diesel.)
9+
- #[derive(diesel::sql_types::SqlType)]
10+
- #[diesel(postgres_type(name = "tsvector", schema = "pg_catalog"))]
11+
- pub struct Tsvector;
12+
+ pub use diesel_full_text_search::Tsvector;
13+
}
14+
15+
diesel::table! {
16+
@@ -71,13 +69,13 @@ diesel::table! {
17+
/// Its SQL type is `Nullable<Array<Nullable<Text>>>`.
18+
///
19+
/// (Automatically generated by Diesel.)
20+
- crate_scopes -> Nullable<Array<Nullable<Text>>>,
21+
+ crate_scopes -> Nullable<Array<Text>>,
22+
/// The `endpoint_scopes` column of the `api_tokens` table.
23+
///
24+
/// Its SQL type is `Nullable<Array<Nullable<Text>>>`.
25+
///
26+
/// (Automatically generated by Diesel.)
27+
- endpoint_scopes -> Nullable<Array<Nullable<Text>>>,
28+
+ endpoint_scopes -> Nullable<Array<Text>>,
29+
}
30+
}
31+
32+
@@ -195,12 +193,6 @@ diesel::table! {
1233
///
1334
/// (Automatically generated by Diesel.)
1435
created_at -> Timestamp,
@@ -21,11 +42,20 @@ index 27d068510..f2a8546aa 100644
2142
}
2243
}
2344

24-
@@ -701,6 +697,24 @@ table! {
45+
@@ -473,7 +465,7 @@ diesel::table! {
46+
/// Its SQL type is `Array<Nullable<Text>>`.
47+
///
48+
/// (Automatically generated by Diesel.)
49+
- features -> Array<Nullable<Text>>,
50+
+ features -> Array<Text>,
51+
/// The `target` column of the `dependencies` table.
52+
///
53+
/// Its SQL type is `Nullable<Varchar>`.
54+
@@ -677,6 +669,24 @@ diesel::table! {
2555
}
2656
}
2757

28-
+table! {
58+
+diesel::table! {
2959
+ /// Representation of the `recent_crate_downloads` view.
3060
+ ///
3161
+ /// This data represents the downloads in the last 90 days.
@@ -43,28 +73,28 @@ index 27d068510..f2a8546aa 100644
4373
+ }
4474
+}
4575
+
46-
table! {
47-
use diesel::sql_types::*;
48-
use diesel_full_text_search::{TsVector as Tsvector};
49-
@@ -1028,7 +1042,8 @@ joinable!(api_tokens -> users (user_id));
50-
joinable!(badges -> crates (crate_id));
51-
joinable!(crate_owner_invitations -> crates (crate_id));
52-
joinable!(crate_owners -> crates (crate_id));
53-
-joinable!(crate_owners -> users (created_by));
54-
+joinable!(crate_owners -> teams (owner_id));
55-
+joinable!(crate_owners -> users (owner_id));
56-
joinable!(crates_categories -> categories (category_id));
57-
joinable!(crates_categories -> crates (crate_id));
58-
joinable!(crates_keywords -> crates (crate_id));
59-
@@ -1041,6 +1056,7 @@ joinable!(follows -> users (user_id));
60-
joinable!(publish_limit_buckets -> users (user_id));
61-
joinable!(publish_rate_overrides -> users (user_id));
62-
joinable!(readme_renderings -> versions (version_id));
63-
+joinable!(recent_crate_downloads -> crates (crate_id));
64-
joinable!(version_downloads -> versions (version_id));
65-
joinable!(version_owner_actions -> api_tokens (api_token_id));
66-
joinable!(version_owner_actions -> users (user_id));
67-
@@ -1067,6 +1083,7 @@ allow_tables_to_appear_in_same_query!(
76+
diesel::table! {
77+
/// Representation of the `reserved_crate_names` table.
78+
///
79+
@@ -983,7 +993,8 @@ diesel::joinable!(api_tokens -> users (user_id));
80+
diesel::joinable!(badges -> crates (crate_id));
81+
diesel::joinable!(crate_owner_invitations -> crates (crate_id));
82+
diesel::joinable!(crate_owners -> crates (crate_id));
83+
-diesel::joinable!(crate_owners -> users (created_by));
84+
+diesel::joinable!(crate_owners -> teams (owner_id));
85+
+diesel::joinable!(crate_owners -> users (owner_id));
86+
diesel::joinable!(crates_categories -> categories (category_id));
87+
diesel::joinable!(crates_categories -> crates (crate_id));
88+
diesel::joinable!(crates_keywords -> crates (crate_id));
89+
@@ -996,6 +1007,7 @@ diesel::joinable!(follows -> users (user_id));
90+
diesel::joinable!(publish_limit_buckets -> users (user_id));
91+
diesel::joinable!(publish_rate_overrides -> users (user_id));
92+
diesel::joinable!(readme_renderings -> versions (version_id));
93+
+diesel::joinable!(recent_crate_downloads -> crates (crate_id));
94+
diesel::joinable!(version_downloads -> versions (version_id));
95+
diesel::joinable!(version_owner_actions -> api_tokens (api_token_id));
96+
diesel::joinable!(version_owner_actions -> users (user_id));
97+
@@ -1022,6 +1034,7 @@ diesel::allow_tables_to_appear_in_same_query!(
6898
publish_limit_buckets,
6999
publish_rate_overrides,
70100
readme_renderings,

0 commit comments

Comments
 (0)