What problem does it solve?
Managing Snowflake database schema changes (tables, views, procedures, etc.) across multiple environments and ensuring consistent deployments can be error-prone and difficult to track without a robust version control system. This skill provides a migration-based approach to automate and standardize schema deployments.
Core Features & Use Cases
- Migration-Based Deployment: Use versioned (V__), repeatable (R__), and always (A__) scripts to manage different types of database changes.
- Idempotent Scripting: Leverage
CREATE OR ALTER for views, functions, and procedures to preserve metadata and ensure safe re-execution.
- CI/CD Integration: Seamlessly integrate schema deployments into your CI/CD pipelines for automated, consistent releases across dev, staging, and production.
- Use Case: Implement a new feature requiring a new table, a new view, and an updated stored procedure. Use schemachange to define these changes in version-controlled SQL scripts, then deploy them automatically to all environments, ensuring data integrity and auditability.
Quick Start
Dry run to preview changes
schemachange deploy --config-folder . --dry-run
Deploy changes to Snowflake
schemachange deploy --config-folder .
Deploy with environment-specific variables
schemachange deploy --vars '{"env":"prod","schema":"data"}'