diff --git a/CHANGELOG.md b/CHANGELOG.md index 85a96308..9bdad1dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,13 @@ Year format is defined as: `YYYY-m-d` ## [Unreleased] -## [0.4.1 - 2023 - 04 - 23 +## [0.4.2 - 2023 - 05 - 02] + +### Bugfix + +Fixed a bug related to migrations that prevented compiling if features were not specified. + +## [0.4.1 - 2023 - 04 - 23] ### Feature diff --git a/Cargo.toml b/Cargo.toml index 402a49a7..341a28dd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,11 +33,11 @@ tokio-postgres = { workspace = true, optional = true } tiberius = { workspace = true, optional = true } [workspace.dependencies] -canyon_crud = { version = "0.4.1", path = "canyon_crud" } -canyon_connection = { version = "0.4.1", path = "canyon_connection" } -canyon_entities = { version = "0.4.1", path = "canyon_entities" } -canyon_migrations = { version = "0.4.1", path = "canyon_migrations"} -canyon_macros = { version = "0.4.1", path = "canyon_macros" } +canyon_crud = { version = "0.4.2", path = "canyon_crud" } +canyon_connection = { version = "0.4.2", path = "canyon_connection" } +canyon_entities = { version = "0.4.2", path = "canyon_entities" } +canyon_migrations = { version = "0.4.2", path = "canyon_migrations"} +canyon_macros = { version = "0.4.2", path = "canyon_macros" } tokio = { version = "1.27.0", features = ["full"] } tokio-util = { version = "0.7.4", features = ["compat"] } @@ -61,7 +61,7 @@ quote = "1.0.9" proc-macro2 = "1.0.27" [workspace.package] -version = "0.4.1" +version = "0.4.2" edition = "2021" authors = ["Alex Vergara, Gonzalo Busto Musi"] documentation = "https://zerodaycode.github.io/canyon-book/" diff --git a/bash_aliases.sh b/bash_aliases.sh index aee09cd7..64b40415 100644 --- a/bash_aliases.sh +++ b/bash_aliases.sh @@ -7,7 +7,7 @@ # In order to run the script, simply type `$ . ./bash_aliases.sh` from the root of the project. # (refreshing the current terminal session could be required) -# Executes the docker compose script to wake up the postgres container +# Executes the docker compose script to wake up the containers alias DockerUp='docker-compose -f ./docker/docker-compose.yml up' # Shutdown the postgres container alias DockerDown='docker-compose -f ./docker/docker-compose.yml down' diff --git a/src/lib.rs b/src/lib.rs index 1d2e3375..d89f79b2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,9 +6,11 @@ extern crate canyon_connection; extern crate canyon_crud; extern crate canyon_macros; +#[cfg(feature = "migrations")] extern crate canyon_migrations; /// Reexported elements to the root of the public API +#[cfg(feature = "migrations")] pub mod migrations { pub use canyon_migrations::migrations::{handler, processor}; } diff --git a/tests/constants.rs b/tests/constants.rs index 1c9c8044..dd3a268b 100644 --- a/tests/constants.rs +++ b/tests/constants.rs @@ -5,7 +5,7 @@ pub const PSQL_DS: &str = "postgres_docker"; #[cfg(feature = "mssql")] pub const SQL_SERVER_DS: &str = "sqlserver_docker"; -#[cfg(feature = "postgres")] +#[cfg(all(feature = "postgres", feature = "migrations"))] pub static FETCH_PUBLIC_SCHEMA: &str = "SELECT gi.table_name, diff --git a/tests/migrations/mod.rs b/tests/migrations/mod.rs index 47f82566..01260fb3 100644 --- a/tests/migrations/mod.rs +++ b/tests/migrations/mod.rs @@ -1,11 +1,12 @@ #![allow(unused_imports)] -///! Integration tests for the migrations feature of `Canyon-SQL` -use canyon_sql::{crud::Transaction, migrations::handler::Migrations}; - use crate::constants; +///! Integration tests for the migrations feature of `Canyon-SQL` +use canyon_sql::crud::Transaction; +#[cfg(feature = "migrations")] +use canyon_sql::migrations::handler::Migrations; /// Brings the information of the `PostgreSQL` requested schema -#[cfg(feature = "postgres")] +#[cfg(all(feature = "postgres", feature = "migrations"))] #[canyon_sql::macros::canyon_tokio_test] fn test_migrations_postgresql_status_query() { let results = Migrations::query(constants::FETCH_PUBLIC_SCHEMA, [], constants::PSQL_DS).await;