diff --git a/bin/test b/bin/test index 1a05a26fe11b..793b596d4b8b 100755 --- a/bin/test +++ b/bin/test @@ -24,14 +24,14 @@ else (cd diesel_cli && cargo test --features "sqlite" --no-default-features "$*") (cd diesel_migrations && cargo test --features "sqlite diesel/sqlite" "$*") (cd diesel_migrations && cargo test --features "sqlite diesel/sqlite" "$*") - (cd diesel_derives && cargo test --features "diesel/sqlite" "$*") + (cd diesel_derives && cargo test --features "sqlite diesel/sqlite" "$*") (cd diesel_tests && cargo test --features "sqlite" --no-default-features "$*") (cd diesel_dynamic_schema && cargo test --features "sqlite diesel/sqlite" "$*") (cd diesel_bench && cargo test --features "sqlite" --benches "$*") (cd diesel_migrations && cargo test --features "postgres diesel/postgres" "$*") (cd diesel_migrations/migrations_macros && cargo test --features "diesel/postgres postgres" "$*") - (cd diesel_derives && cargo test --features "diesel/postgres" "$*") + (cd diesel_derives && cargo test --features "postgres diesel/postgres" "$*") (cd diesel_cli && cargo test --features "postgres" --no-default-features "$*") (cd diesel_tests && cargo test --features "postgres" --no-default-features "$*") (cd diesel_dynamic_schema && cargo test --features "postgres diesel/postgres" "$*") @@ -39,7 +39,7 @@ else (cd diesel_migrations && cargo test --features "mysql diesel/mysql" "$*" -- --test-threads 1) (cd diesel_migrations/migrations_macros && cargo test --features "diesel/mysql mysql" "$*" -- --test-threads 1) - (cd diesel_derives && cargo test --features "diesel/mysql" "$*" -- --test-threads 1) + (cd diesel_derives && cargo test --features "mysql diesel/mysql" "$*" -- --test-threads 1) (cd diesel_cli && cargo test --features "mysql" --no-default-features "$*" -- --test-threads 1) (cd diesel_tests && cargo test --features "mysql" --no-default-features "$*" -- --test-threads 1) (cd diesel_dynamic_schema && cargo test --features "mysql diesel/mysql" "$*" -- --test-threads 1) diff --git a/diesel_cli/src/infer_schema_internals/foreign_keys.rs b/diesel_cli/src/infer_schema_internals/foreign_keys.rs index 35c7b6598031..9c1d751b38e2 100644 --- a/diesel_cli/src/infer_schema_internals/foreign_keys.rs +++ b/diesel_cli/src/infer_schema_internals/foreign_keys.rs @@ -33,7 +33,7 @@ pub fn remove_unsafe_foreign_keys_for_codegen( "Error loading primary keys for `{}`", fk.parent_table )); - pk_columns.len() == 1 && Some(&pk_columns[0]) == fk.primary_key_columns.get(0) + pk_columns.len() == 1 && Some(&pk_columns[0]) == fk.primary_key_columns.first() }) .filter(|fk| !duplicates.contains(&fk.ordered_tables())) .cloned() diff --git a/diesel_compile_tests/Cargo.lock b/diesel_compile_tests/Cargo.lock index 021b16f7f8a3..7922e9090c94 100644 --- a/diesel_compile_tests/Cargo.lock +++ b/diesel_compile_tests/Cargo.lock @@ -64,7 +64,7 @@ dependencies = [ [[package]] name = "diesel" -version = "2.0.2" +version = "2.1.4" dependencies = [ "bigdecimal", "bitflags 2.2.1", @@ -98,7 +98,7 @@ dependencies = [ [[package]] name = "diesel_derives" -version = "2.0.2" +version = "2.1.2" dependencies = [ "diesel_table_macro_syntax", "proc-macro2", diff --git a/diesel_tests/tests/joins.rs b/diesel_tests/tests/joins.rs index bc4a447c480d..85b1c5c3182f 100644 --- a/diesel_tests/tests/joins.rs +++ b/diesel_tests/tests/joins.rs @@ -44,7 +44,8 @@ fn select_single_from_join() { let select_title = source.select(posts::title); let expected_names = vec!["Sean".to_string(), "Tess".to_string()]; - let actual_names: Vec = select_name.load(connection).unwrap(); + let mut actual_names: Vec = select_name.load(connection).unwrap(); + actual_names.sort(); assert_eq!(expected_names, actual_names); diff --git a/examples/mysql/getting_started_step_1/src/schema.rs b/examples/mysql/getting_started_step_1/src/schema.rs index 54b162bb0c20..bde3174fd3e4 100644 --- a/examples/mysql/getting_started_step_1/src/schema.rs +++ b/examples/mysql/getting_started_step_1/src/schema.rs @@ -3,6 +3,7 @@ diesel::table! { posts (id) { id -> Integer, + #[max_length = 255] title -> Varchar, body -> Text, published -> Bool, diff --git a/examples/mysql/getting_started_step_2/src/schema.rs b/examples/mysql/getting_started_step_2/src/schema.rs index 54b162bb0c20..bde3174fd3e4 100644 --- a/examples/mysql/getting_started_step_2/src/schema.rs +++ b/examples/mysql/getting_started_step_2/src/schema.rs @@ -3,6 +3,7 @@ diesel::table! { posts (id) { id -> Integer, + #[max_length = 255] title -> Varchar, body -> Text, published -> Bool, diff --git a/examples/mysql/getting_started_step_3/src/schema.rs b/examples/mysql/getting_started_step_3/src/schema.rs index 54b162bb0c20..bde3174fd3e4 100644 --- a/examples/mysql/getting_started_step_3/src/schema.rs +++ b/examples/mysql/getting_started_step_3/src/schema.rs @@ -3,6 +3,7 @@ diesel::table! { posts (id) { id -> Integer, + #[max_length = 255] title -> Varchar, body -> Text, published -> Bool, diff --git a/examples/postgres/advanced-blog-cli/src/schema.rs b/examples/postgres/advanced-blog-cli/src/schema.rs index ee6346c63e2e..15ba5ccc5d51 100644 --- a/examples/postgres/advanced-blog-cli/src/schema.rs +++ b/examples/postgres/advanced-blog-cli/src/schema.rs @@ -37,4 +37,8 @@ diesel::joinable!(comments -> posts (post_id)); diesel::joinable!(comments -> users (user_id)); diesel::joinable!(posts -> users (user_id)); -diesel::allow_tables_to_appear_in_same_query!(comments, posts, users,); +diesel::allow_tables_to_appear_in_same_query!( + comments, + posts, + users, +); diff --git a/examples/postgres/relations/src/schema.rs b/examples/postgres/relations/src/schema.rs index 4ca1214321a4..10163ab9e0f1 100644 --- a/examples/postgres/relations/src/schema.rs +++ b/examples/postgres/relations/src/schema.rs @@ -34,4 +34,9 @@ diesel::joinable!(books_authors -> authors (author_id)); diesel::joinable!(books_authors -> books (book_id)); diesel::joinable!(pages -> books (book_id)); -diesel::allow_tables_to_appear_in_same_query!(authors, books, books_authors, pages,); +diesel::allow_tables_to_appear_in_same_query!( + authors, + books, + books_authors, + pages, +); diff --git a/rust-toolchain b/rust-toolchain index ee2f4ca91304..dc87e8af82f6 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.68.0 +1.74.0