diff --git a/CHANGELOG.md b/CHANGELOG.md index 656504ce..f409859f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. *The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).* +## [4.0.0] - TBD +### Added +- use of structlog for standard log outputs + +### Changed +- Refactored the main cli.py to be more modular to aide in future development and testing. + + ## [3.7.0] - 2024-07-22 ### Added - Improved unit test coverage diff --git a/demo/provision/setup_schemachange_schema.sql b/demo/provision/setup_schemachange_schema.sql index 0c4322ce..6be6ad30 100644 --- a/demo/provision/setup_schemachange_schema.sql +++ b/demo/provision/setup_schemachange_schema.sql @@ -38,6 +38,7 @@ GRANT DATABASE ROLE IDENTIFIER($SC_W) TO DATABASE ROLE IDENTIFIER($SC_C); CREATE SCHEMA IF NOT EXISTS IDENTIFIER($TARGET_SCHEMA_NAME) WITH MANAGED ACCESS; -- USE SCHEMA INFORMATION_SCHEMA; -- DROP SCHEMA IF EXISTS PUBLIC; +GRANT OWNERSHIP ON IDENTIFIER($TARGET_SCHEMA_NAME) TO ROLE IDENTIFIER($DEPLOY_ROLE); USE SCHEMA IDENTIFIER($SCHEMACHANGE_NAMESPACE); -- SCHEMA diff --git a/demo/setup/basics_demo/A__setup_basics_demo.sql b/demo/setup/basics_demo/A__setup_basics_demo.sql index a39e16fc..31f48df3 100644 --- a/demo/setup/basics_demo/A__setup_basics_demo.sql +++ b/demo/setup/basics_demo/A__setup_basics_demo.sql @@ -31,6 +31,7 @@ GRANT DATABASE ROLE IDENTIFIER($SC_W) TO DATABASE ROLE IDENTIFIER($SC_C); CREATE SCHEMA IF NOT EXISTS IDENTIFIER($TARGET_SCHEMA_NAME) WITH MANAGED ACCESS; -- USE SCHEMA INFORMATION_SCHEMA; -- DROP SCHEMA IF EXISTS PUBLIC; +GRANT OWNERSHIP ON IDENTIFIER($TARGET_SCHEMA_NAME) TO ROLE IDENTIFIER($DEPLOY_ROLE); USE SCHEMA IDENTIFIER($SCHEMACHANGE_NAMESPACE); -- SCHEMA diff --git a/demo/setup/citibike_demo/A__setup_citibike_demo.sql b/demo/setup/citibike_demo/A__setup_citibike_demo.sql index a39e16fc..31f48df3 100644 --- a/demo/setup/citibike_demo/A__setup_citibike_demo.sql +++ b/demo/setup/citibike_demo/A__setup_citibike_demo.sql @@ -31,6 +31,7 @@ GRANT DATABASE ROLE IDENTIFIER($SC_W) TO DATABASE ROLE IDENTIFIER($SC_C); CREATE SCHEMA IF NOT EXISTS IDENTIFIER($TARGET_SCHEMA_NAME) WITH MANAGED ACCESS; -- USE SCHEMA INFORMATION_SCHEMA; -- DROP SCHEMA IF EXISTS PUBLIC; +GRANT OWNERSHIP ON IDENTIFIER($TARGET_SCHEMA_NAME) TO ROLE IDENTIFIER($DEPLOY_ROLE); USE SCHEMA IDENTIFIER($SCHEMACHANGE_NAMESPACE); -- SCHEMA diff --git a/demo/setup/citibike_demo_jinja/A__setup_citibike_demo_jinja.sql b/demo/setup/citibike_demo_jinja/A__setup_citibike_demo_jinja.sql index a39e16fc..31f48df3 100644 --- a/demo/setup/citibike_demo_jinja/A__setup_citibike_demo_jinja.sql +++ b/demo/setup/citibike_demo_jinja/A__setup_citibike_demo_jinja.sql @@ -31,6 +31,7 @@ GRANT DATABASE ROLE IDENTIFIER($SC_W) TO DATABASE ROLE IDENTIFIER($SC_C); CREATE SCHEMA IF NOT EXISTS IDENTIFIER($TARGET_SCHEMA_NAME) WITH MANAGED ACCESS; -- USE SCHEMA INFORMATION_SCHEMA; -- DROP SCHEMA IF EXISTS PUBLIC; +GRANT OWNERSHIP ON IDENTIFIER($TARGET_SCHEMA_NAME) TO ROLE IDENTIFIER($DEPLOY_ROLE); USE SCHEMA IDENTIFIER($SCHEMACHANGE_NAMESPACE); -- SCHEMA diff --git a/schemachange/cli.py b/schemachange/cli.py index d6fe54f0..f896d096 100644 --- a/schemachange/cli.py +++ b/schemachange/cli.py @@ -13,7 +13,7 @@ # region Global Variables # metadata -SCHEMACHANGE_VERSION = "3.7.0" +SCHEMACHANGE_VERSION = "4.0.0" SNOWFLAKE_APPLICATION_NAME = "schemachange" module_logger = structlog.getLogger(__name__) diff --git a/tests/test_cli_misc.py b/tests/test_cli_misc.py index e5877b17..97bbc686 100644 --- a/tests/test_cli_misc.py +++ b/tests/test_cli_misc.py @@ -10,7 +10,7 @@ def test_cli_given__schemachange_version_change_updated_in_setup_config_file(): - assert SCHEMACHANGE_VERSION == "3.7.0" + assert SCHEMACHANGE_VERSION == "4.0.0" def test_cli_given__constants_exist():