Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions crates/crates_io_database/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ workspace = true
[dependencies]
diesel = "=2.2.4"
diesel_full_text_search = "=2.2.0"

[dev-dependencies]
crates_io_test_db = { path = "../crates_io_test_db" }
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use crates_io_test_db::TestDatabase;
use diesel::prelude::*;
use diesel::sql_types::Text;

use crate::tests::TestApp;

#[test]
fn all_columns_called_crate_id_have_a_cascading_foreign_key() {
for row in get_fk_constraint_definitions("crate_id") {
Expand Down Expand Up @@ -70,8 +69,8 @@ struct TableNameAndConstraint {
fn get_fk_constraint_definitions(column_name: &str) -> Vec<TableNameAndConstraint> {
use diesel::sql_query;

let (app, _) = TestApp::init().empty();
let mut conn = app.db_conn();
let test_db = TestDatabase::new();
let mut conn = test_db.connect();

sql_query(include_str!("load_foreign_key_constraints.sql"))
.bind::<Text, _>(column_name)
Expand Down
1 change: 0 additions & 1 deletion src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ mod owners;
mod pagination;
mod read_only_mode;
mod routes;
mod schema_details;
mod server;
mod team;
mod token;
Expand Down