Skip to content

Commit d7c7c56

Browse files
authored
Extract crates_io_database crate (#9648)
1 parent 873bc1f commit d7c7c56

File tree

8 files changed

+31
-8
lines changed

8 files changed

+31
-8
lines changed

Cargo.lock

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ base64 = "=0.22.1"
4949
bigdecimal = { version = "=0.4.5", features = ["serde"] }
5050
cargo-manifest = "=0.15.2"
5151
crates_io_cdn_logs = { path = "crates/crates_io_cdn_logs" }
52+
crates_io_database = { path = "crates/crates_io_database" }
5253
crates_io_env_vars = { path = "crates/crates_io_env_vars" }
5354
crates_io_github = { path = "crates/crates_io_github" }
5455
crates_io_index = { path = "crates/crates_io_index" }

crates/crates_io_database/Cargo.toml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[package]
2+
name = "crates_io_database"
3+
version = "0.0.0"
4+
license = "MIT OR Apache-2.0"
5+
edition = "2021"
6+
7+
[lints]
8+
workspace = true
9+
10+
[dependencies]
11+
diesel = "=2.2.4"
12+
diesel_full_text_search = "=2.2.0"

crates/crates_io_database/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub mod schema;

src/schema.patch crates/crates_io_database/src/schema.patch

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
--- src/schema.rs.orig 2024-03-04 10:34:35
2-
+++ src/schema.rs 2024-03-04 10:33:35
1+
--- crates/crates_io_database/schema.rs.orig 2024-03-04 10:34:35
2+
+++ crates/crates_io_database/schema.rs 2024-03-04 10:33:35
33
@@ -21,9 +21,7 @@
44
/// The `pg_catalog.tsvector` SQL type
55
///
@@ -9,7 +9,7 @@
99
- pub struct Tsvector;
1010
+ pub use diesel_full_text_search::Tsvector;
1111
}
12-
12+
1313
diesel::table! {
1414
@@ -74,9 +72,9 @@
1515
/// (Automatically generated by Diesel.)
@@ -35,7 +35,7 @@
3535
- path -> Ltree,
3636
}
3737
}
38-
38+
3939
@@ -476,7 +468,7 @@
4040
/// Its SQL type is `Array<Nullable<Text>>`.
4141
///
@@ -47,7 +47,7 @@
4747
/// Its SQL type is `Nullable<Varchar>`.
4848
@@ -703,6 +695,24 @@
4949
}
50-
50+
5151
diesel::table! {
5252
+ /// Representation of the `recent_crate_downloads` view.
5353
+ ///
File renamed without changes.

diesel.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# For documentation on how to configure this file,
22
# see diesel.rs/guides/configuring-diesel-cli
33
[print_schema]
4-
file = "src/schema.rs"
4+
file = "crates/crates_io_database/src/schema.rs"
55
with_docs = true
6-
patch_file = "src/schema.patch"
6+
patch_file = "crates/crates_io_database/src/schema.patch"

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ extern crate serde_json;
1919
extern crate tracing;
2020

2121
pub use crate::{app::App, email::Emails};
22+
pub use crates_io_database::schema;
2223
use std::sync::Arc;
2324

2425
use crate::app::AppState;
@@ -49,7 +50,6 @@ pub mod models;
4950
pub mod rate_limiter;
5051
mod real_ip;
5152
mod router;
52-
pub mod schema;
5353
pub mod sentry;
5454
pub mod sql;
5555
pub mod sqs;

0 commit comments

Comments
 (0)