Skip to content

Commit ae0ad71

Browse files
committed
Move more thing around
1. Move everything related to migrations into diesel_migration - diesel_migrations/migrations_internals contains everything that was in diesel/src/migrations - diesel_migrations/migrations_macros contains the procedural macro implementation for `embed_migrations!` - diesel_migrations rexports everything related to migrations 2. Rename and restructure diesel_proc_macro - diesel_infer_schema is moved and renamed to diesel_infer_schema/infer_schema_internals - diesel_proc_macro_internal is moved to diesel_infer_schema/infer_schema_macros and everything related to migrations is removed - diesel_proc_macro is renamed to diesel_infer_schema and everything related to migrations is removed 3. Fix hopefully all other crates
1 parent fef4473 commit ae0ad71

69 files changed

Lines changed: 1693 additions & 176 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.appveyor.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,18 @@ test_script:
4545
- cargo test
4646
- cd ../diesel
4747
- cargo test --features "%backend% extras"
48-
- cd ../diesel_proc_macro
48+
- cd ../diesel_infer_schema/infer_schema_internals
49+
- cargo test --features "%backend%"
50+
- cd ../../diesel_infer_schema/infer_schema_macros
51+
- cargo test --features "%backend% dotenv"
52+
- cd ../../diesel_infer_schema
4953
- cargo test --features "%backend% dotenv_macro"
54+
- cd ../diesel_migrations/migrations_internals
55+
- cargo test
56+
- cd ../../diesel_migrations/migrations_macros
57+
- cargo test
58+
- cd ../../diesel_migrations/
59+
- cargo test --features "%backend%"
5060
- cd ../diesel_cli
5161
- cargo test --no-default-features --features "%backend%"
5262
- cd ../diesel_tests

.travis.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ before_script:
1414
- mysql -e "create database diesel_test; create database diesel_unit_test; grant all on \`diesel_%\`.* to 'travis'@'%';" -uroot
1515
script:
1616
- |
17-
(cd diesel_codegen && travis-cargo test) &&
1817
if [[ "$TRAVIS_RUST_VERSION" == nightly* ]]; then
1918
(cd diesel && travis-cargo test -- --no-default-features --features "unstable extras $BACKEND")
2019
else
2120
(cd diesel && travis-cargo test -- --no-default-features --features "extras $BACKEND")
2221
fi &&
2322
(cd diesel && travis-cargo test -- --no-default-features --features "extras with-deprecated $BACKEND") &&
23+
(cd diesel_codegen && travis-cargo test -- --features "$BACKEND") &&
2424
if [[ "$BACKEND" == postgres ]]; then
2525
(cd examples/postgres && ./test_all)
2626
fi &&
@@ -31,9 +31,12 @@ script:
3131
(cd examples/sqlite && ./test_all)
3232
fi &&
3333
(cd diesel_cli && travis-cargo test -- --no-default-features --features "$BACKEND") &&
34-
(cd diesel_infer_schema && travis-cargo test -- --no-default-features --features "$BACKEND") &&
35-
(cd diesel_proc_macro_internal && travis-cargo test -- --no-default-features --features "dotenv $BACKEND") &&
36-
(cd diesel_proc_macro && travis-cargo test -- --no-default-features --features "dotenv_macro $BACKEND") &&
34+
(cd diesel_infer_schema/infer_schema_internals && travis-cargo test -- --no-default-features --features "$BACKEND") &&
35+
(cd diesel_infer_schema/infer_schema_macros && travis-cargo test -- --no-default-features --features "$BACKEND") &&
36+
(cd diesel_infer_schema && travis-cargo test -- --no-default-features --features "dotenv_macro $BACKEND") &&
37+
(cd diesel_migrations/migrations_internals && travis-cargo test ) &&
38+
(cd diesel_migrations/migrations_macros && travis-cargo test ) &&
39+
(cd diesel_migrations/ && travis-cargo test --features "$BACKEND" ) &&
3740
if [[ "$TRAVIS_RUST_VERSION" == nightly* ]]; then
3841
(cd diesel_tests && travis-cargo test -- --no-default-features --features "unstable $BACKEND")
3942
else

Cargo.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ members = [
77
# "diesel_compile_tests",
88
"diesel_tests",
99
"diesel_infer_schema",
10-
"diesel_proc_macro",
11-
"diesel_proc_macro_internal",
10+
"diesel_infer_schema/infer_schema_internals",
11+
"diesel_infer_schema/infer_schema_macros",
12+
"diesel_migrations",
13+
"diesel_migrations/migrations_internals",
14+
"diesel_migrations/migrations_macros",
1215
"examples/mysql/getting_started_step_1",
1316
"examples/mysql/getting_started_step_2",
1417
"examples/mysql/getting_started_step_3",
@@ -25,5 +28,3 @@ members = [
2528
"diesel:0.16.0" = { path = "diesel" }
2629
"diesel_codegen:0.16.0" = { path = "diesel_codegen" }
2730
"diesel_infer_schema:0.16.0" = { path = "diesel_infer_schema" }
28-
"diesel_proc_macro_internal:0.16.0" = { path = "diesel_proc_macro_internal" }
29-
"diesel_proc_macro:0.16.0" = { path = "diesel_proc_macro" }

diesel/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ quickcheck = "0.4"
3939
tempdir = "^0.3.4"
4040

4141
[features]
42-
default = ["with-deprecated"]
42+
default = ["with-deprecated", "sqlite"]
4343
extras = ["chrono", "serde_json", "uuid", "deprecated-time", "network-address", "numeric"]
4444
unstable = []
4545
lint = ["clippy"]

diesel/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ pub mod pg;
7272
#[cfg(feature = "sqlite")]
7373
pub mod sqlite;
7474

75-
pub mod migrations;
7675
pub mod query_dsl;
7776
pub mod query_source;
7877
pub mod result;

diesel_cli/Cargo.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ chrono = "0.4"
1919
clap = ">=2.27.0"
2020
diesel = { version = "0.16.0", default-features = false }
2121
dotenv = ">=0.8, <0.11"
22-
diesel_infer_schema = "0.16.0"
22+
infer_schema_internals = { version = "0.16.0", path = "../diesel_infer_schema/infer_schema_internals" }
2323
clippy = { optional = true, version = "=0.0.162" }
24+
migrations_internals = { version = "0.16.0", path = "../diesel_migrations/migrations_internals" }
2425

2526
[dev-dependencies]
2627
difference = "1.0"
@@ -31,9 +32,9 @@ url = { version = "1.4.0" }
3132
[features]
3233
default = ["postgres", "sqlite", "mysql"]
3334
lint = ["clippy"]
34-
postgres = ["diesel/postgres", "diesel_infer_schema/postgres"]
35-
sqlite = ["diesel/sqlite", "diesel_infer_schema/sqlite"]
36-
mysql = ["diesel/mysql", "diesel_infer_schema/mysql"]
35+
postgres = ["diesel/postgres", "infer_schema_internals/postgres"]
36+
sqlite = ["diesel/sqlite", "infer_schema_internals/sqlite"]
37+
mysql = ["diesel/mysql", "infer_schema_internals/mysql"]
3738

3839
[[test]]
3940
name = "tests"

diesel_cli/src/database.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use clap::ArgMatches;
22
use diesel::dsl::sql;
33
use diesel::types::Bool;
44
use diesel::*;
5+
use migrations_internals as migrations;
56
#[cfg(any(feature = "postgres", feature = "mysql"))]
67
use super::query_helper;
78

diesel_cli/src/main.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ extern crate chrono;
1414
extern crate clap;
1515
#[cfg_attr(any(feature = "mysql", feature = "postgres"), macro_use)]
1616
extern crate diesel;
17-
extern crate diesel_infer_schema;
17+
extern crate infer_schema_internals;
1818
extern crate dotenv;
19+
extern crate migrations_internals;
1920

2021
mod database_error;
2122
#[macro_use]
@@ -27,14 +28,14 @@ mod query_helper;
2728

2829
use chrono::*;
2930
use clap::{ArgMatches, Shell};
30-
use diesel::migrations::{self, MigrationConnection};
31+
use migrations_internals::{self as migrations, MigrationConnection};
3132
use std::any::Any;
3233
use std::io::stdout;
3334
use std::path::{Path, PathBuf};
3435
use std::{env, fs};
3536

3637
use self::database_error::{DatabaseError, DatabaseResult};
37-
use diesel::migrations::TIMESTAMP_FORMAT;
38+
use migrations_internals::TIMESTAMP_FORMAT;
3839

3940
fn main() {
4041
use self::dotenv::dotenv;
@@ -303,7 +304,7 @@ fn convert_absolute_path_to_relative(target_path: &Path, mut current_path: &Path
303304
}
304305

305306
fn run_infer_schema(matches: &ArgMatches) {
306-
use diesel_infer_schema::TableName;
307+
use infer_schema_internals::TableName;
307308
use print_schema::*;
308309

309310
let database_url = database::database_url(matches);

diesel_cli/src/print_schema.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use diesel_infer_schema::*;
1+
use infer_schema_internals::*;
22
use std::error::Error;
33
use std::fmt::{self, Display, Formatter, Write};
44

diesel_codegen/Cargo.toml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,23 @@ keywords = ["orm", "database", "postgres", "sql", "codegen"]
1313
[dependencies]
1414
syn = { version = "0.11.4", features = ["aster"] }
1515
quote = "0.3.12"
16-
dotenv = { version = ">=0.8, <0.11", optional = true, default-features = false }
1716
clippy = { optional = true, version = "=0.0.162" }
1817

1918
[dev-dependencies]
19+
dotenv = { version = ">=0.8, <0.11", default-features = false }
2020
tempdir = "0.3.4"
21-
diesel = { version = "0.16", features = ["sqlite"] }
21+
diesel = { version = "0.16", features = ["sqlite", "postgres", "mysql"] }
22+
cfg-if = "0.1.0"
2223

2324
[lib]
2425
proc-macro = true
2526

2627
[features]
27-
default = ["dotenv"]
28+
default = []
2829
lint = ["clippy"]
30+
postgres = []
31+
sqlite = []
32+
mysql = []
2933

3034
[[test]]
3135
name = "tests"

0 commit comments

Comments
 (0)