From 73726abfd97d6c20d68825becce081fe0de15378 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Tue, 15 Oct 2024 05:34:28 +0000 Subject: [PATCH 1/2] schemerz-*: Change default table name This ensures we don't collide with `schemer` going forward. --- schemerz-postgres/CHANGELOG.md | 6 ++++++ schemerz-postgres/src/lib.rs | 2 +- schemerz-rusqlite/CHANGELOG.md | 6 ++++++ schemerz-rusqlite/src/lib.rs | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/schemerz-postgres/CHANGELOG.md b/schemerz-postgres/CHANGELOG.md index 9910c8f..14bbc1e 100644 --- a/schemerz-postgres/CHANGELOG.md +++ b/schemerz-postgres/CHANGELOG.md @@ -9,6 +9,12 @@ and this library adheres to Rust's notion of ## [Unreleased] +### Changed +- **IMPORTANT BREAKING CHANGE**: `schemerz_postgres::PostgresAdapter::new` now + uses a default table name of `_schemerz` when the `table_name` argument is + `None`. If you were not setting this argument before and are migrating from + `schemer`, you will need to set `table_name` to `Some("_schemer".into())`. + ## [0.190.0] - 2024-10-15 Initial release. The API is identical to `schemer-postgres 0.2.0`. diff --git a/schemerz-postgres/src/lib.rs b/schemerz-postgres/src/lib.rs index f757223..0589bd6 100644 --- a/schemerz-postgres/src/lib.rs +++ b/schemerz-postgres/src/lib.rs @@ -102,7 +102,7 @@ impl<'a> PostgresAdapter<'a> { pub fn new(conn: &'a mut Client, table_name: Option) -> PostgresAdapter<'a> { PostgresAdapter { conn, - migration_metadata_table: table_name.unwrap_or_else(|| "_schemer".into()), + migration_metadata_table: table_name.unwrap_or_else(|| "_schemerz".into()), } } diff --git a/schemerz-rusqlite/CHANGELOG.md b/schemerz-rusqlite/CHANGELOG.md index 9d280a4..8f8ef01 100644 --- a/schemerz-rusqlite/CHANGELOG.md +++ b/schemerz-rusqlite/CHANGELOG.md @@ -9,6 +9,12 @@ and this library adheres to Rust's notion of ## [Unreleased] +### Changed +- **IMPORTANT BREAKING CHANGE**: `schemerz_rusqlite::RusqliteAdapter::new` now + uses a default table name of `_schemerz` when the `table_name` argument is + `None`. If you were not setting this argument before and are migrating from + `schemer`, you will need to set `table_name` to `Some("_schemer".into())`. + ## [0.290.0] - 2024-10-15 Initial release. The API is identical to `schemer-rusqlite 0.2.2`. diff --git a/schemerz-rusqlite/src/lib.rs b/schemerz-rusqlite/src/lib.rs index f44840c..f47174a 100644 --- a/schemerz-rusqlite/src/lib.rs +++ b/schemerz-rusqlite/src/lib.rs @@ -114,7 +114,7 @@ impl<'a, E> RusqliteAdapter<'a, E> { pub fn new(conn: &'a mut Connection, table_name: Option) -> RusqliteAdapter<'a, E> { RusqliteAdapter { conn, - migration_metadata_table: table_name.unwrap_or_else(|| "_schemer".into()), + migration_metadata_table: table_name.unwrap_or_else(|| "_schemerz".into()), _err: PhantomData, } } From a2552d0914d8baf0c8499c3242927f6761e2c3ea Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Tue, 15 Oct 2024 05:50:18 +0000 Subject: [PATCH 2/2] schemerz: Rename the one API with `schemer` in its name --- schemerz-postgres/src/lib.rs | 4 ++-- schemerz-rusqlite/src/lib.rs | 4 ++-- schemerz/CHANGELOG.md | 6 ++++++ schemerz/src/lib.rs | 2 +- schemerz/src/testing.rs | 8 ++++---- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/schemerz-postgres/src/lib.rs b/schemerz-postgres/src/lib.rs index 0589bd6..f82fc9b 100644 --- a/schemerz-postgres/src/lib.rs +++ b/schemerz-postgres/src/lib.rs @@ -173,7 +173,7 @@ impl<'a> Adapter for PostgresAdapter<'a> { mod tests { use super::*; use postgres::NoTls; - use schemerz::test_schemer_adapter; + use schemerz::test_schemerz_adapter; use schemerz::testing::*; impl PostgresMigration for TestMigration {} @@ -196,7 +196,7 @@ mod tests { adapter } - test_schemer_adapter!( + test_schemerz_adapter!( let mut conn = build_test_connection(), build_test_adapter(&mut conn)); } diff --git a/schemerz-rusqlite/src/lib.rs b/schemerz-rusqlite/src/lib.rs index f47174a..3dc6fd1 100644 --- a/schemerz-rusqlite/src/lib.rs +++ b/schemerz-rusqlite/src/lib.rs @@ -194,7 +194,7 @@ impl<'a, E: From + Sync + Send + Error + 'static> Adapter mod tests { use super::*; use rusqlite::Error as RusqliteError; - use schemerz::test_schemer_adapter; + use schemerz::test_schemerz_adapter; use schemerz::testing::*; impl RusqliteMigration for TestMigration { @@ -217,7 +217,7 @@ mod tests { adapter } - test_schemer_adapter!( + test_schemerz_adapter!( let mut conn = build_test_connection(), build_test_adapter(&mut conn)); } diff --git a/schemerz/CHANGELOG.md b/schemerz/CHANGELOG.md index 59f2bdf..7bfe899 100644 --- a/schemerz/CHANGELOG.md +++ b/schemerz/CHANGELOG.md @@ -9,6 +9,12 @@ and this library adheres to Rust's notion of ## [Unreleased] +### Added +- `schemerz::test_schemerz_adapter` + +### Removed +- `schemerz::test_schemer_adapter` (use `test_schemerz_adapter` instead). + ## [0.1.0] - 2024-10-15 Initial release. The API is identical to `schemer 0.2.1`. diff --git a/schemerz/src/lib.rs b/schemerz/src/lib.rs index ce81568..b692f7a 100644 --- a/schemerz/src/lib.rs +++ b/schemerz/src/lib.rs @@ -403,5 +403,5 @@ pub mod tests { } } - test_schemer_adapter!(DefaultTestAdapter::new()); + test_schemerz_adapter!(DefaultTestAdapter::new()); } diff --git a/schemerz/src/testing.rs b/schemerz/src/testing.rs index ce33dd6..b73ebab 100644 --- a/schemerz/src/testing.rs +++ b/schemerz/src/testing.rs @@ -54,15 +54,15 @@ impl Migration for TestMigration { /// MyAdapterType {} /// } /// -/// test_schemer_adapter!(construct_my_adapter_test_fixture()); +/// test_schemerz_adapter!(construct_my_adapter_test_fixture()); /// ``` #[macro_export] -macro_rules! test_schemer_adapter { +macro_rules! test_schemerz_adapter { ($constructor:expr) => { - test_schemer_adapter!({}, $constructor); + test_schemerz_adapter!({}, $constructor); }; ($setup:stmt, $constructor:expr) => { - test_schemer_adapter!($setup, $constructor, + test_schemerz_adapter!($setup, $constructor, test_single_migration, test_migration_chain, test_multi_component_dag,