diff --git a/src/migration/mod.rs b/src/migration/mod.rs index 8c16c7be..0279d5a4 100644 --- a/src/migration/mod.rs +++ b/src/migration/mod.rs @@ -1,6 +1,7 @@ pub mod cli; pub mod manager; pub mod migrator; +pub mod prelude; pub mod seaql_migrations; pub use cli::*; diff --git a/src/migration/prelude.rs b/src/migration/prelude.rs new file mode 100644 index 00000000..dfce2d6a --- /dev/null +++ b/src/migration/prelude.rs @@ -0,0 +1,10 @@ +pub use super::cli; +pub use super::manager::SchemaManager; +pub use super::migrator::MigratorTrait; +pub use super::{MigrationName, MigrationTrait}; +pub use async_std; +pub use async_trait; +pub use sea_orm; +pub use sea_orm::sea_query; +pub use sea_orm::sea_query::*; +pub use sea_orm::DbErr; diff --git a/tests/migration/src/lib.rs b/tests/migration/src/lib.rs index 9dbb0439..70b5d45a 100644 --- a/tests/migration/src/lib.rs +++ b/tests/migration/src/lib.rs @@ -1,4 +1,4 @@ -use sea_schema::migration::*; +use sea_schema::migration::prelude::*; mod m20220118_000001_create_cake_table; mod m20220118_000002_create_fruit_table; diff --git a/tests/migration/src/m20220118_000001_create_cake_table.rs b/tests/migration/src/m20220118_000001_create_cake_table.rs index d12c7095..2bf1ccf0 100644 --- a/tests/migration/src/m20220118_000001_create_cake_table.rs +++ b/tests/migration/src/m20220118_000001_create_cake_table.rs @@ -1,7 +1,4 @@ -use sea_schema::migration::{ - sea_query::{self, *}, - *, -}; +use sea_schema::migration::prelude::*; pub struct Migration; diff --git a/tests/migration/src/m20220118_000002_create_fruit_table.rs b/tests/migration/src/m20220118_000002_create_fruit_table.rs index 22931b46..02cd0c6e 100644 --- a/tests/migration/src/m20220118_000002_create_fruit_table.rs +++ b/tests/migration/src/m20220118_000002_create_fruit_table.rs @@ -1,9 +1,6 @@ use crate::m20220118_000001_create_cake_table::Cake; -use sea_schema::migration::{ - sea_orm::DbBackend, - sea_query::{self, *}, - *, -}; +use sea_orm::DbBackend; +use sea_schema::migration::prelude::*; pub struct Migration; diff --git a/tests/migration/src/main.rs b/tests/migration/src/main.rs index df1934d4..50a666f3 100644 --- a/tests/migration/src/main.rs +++ b/tests/migration/src/main.rs @@ -1,4 +1,4 @@ -use sea_schema::migration::*; +use sea_schema::migration::prelude::*; use sea_schema_migration_test::Migrator; #[async_std::main]