Schemachange

Deploy versioned Snowflake schema migrations with V__, R__, and A__ scripts.

34|13|Updated Feb 1, 2022
One-click install
npx skills add https://github.com/sfc-gh-dflippo/snowflake-dbt-demo --skill schemachange
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Schemachange
Source: https://github.com/sfc-gh-dflippo/snowflake-dbt-demo/tree/main/.claude/skills/schemachange
Command: npx skills add https://github.com/sfc-gh-dflippo/snowflake-dbt-demo --skill schemachange

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires schemachange, and includes config (resource) and references (resource) components.

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"}'

Frequently Asked Questions about Schemachange

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate Snowflake schema deployments across environments?

Schema deployments automate database changes using version-controlled SQL scripts organized by type (V__ versioned, R__ repeatable, A__ always). Schemachange executes these scripts in prescribed order across dev, staging, and production, ensuring consistent, auditable rollouts without manual intervention.

Can I integrate schema migrations into my CI/CD pipeline?

Yes. Schemachange integrates directly into CI/CD pipelines to deploy schema changes automatically. Use dry-run mode to preview changes, then deploy with environment-specific variables for hands-off, repeatable releases across all environments.

What's the best way to manage Snowflake table, view, and procedure changes in version control?

Use schemachange's migration-based approach with versioned scripts for new objects, repeatable scripts for idempotent updates, and always scripts for recurring setup. Each script type executes in order, preserving metadata and enabling safe re-execution via CREATE OR ALTER syntax.

Does schemachange handle database objects that dbt doesn't cover?

Yes. Schemachange manages schema migrations for database objects outside dbt's scope—tables, views, procedures, and other schema-level changes—while dbt handles data transformation. Both tools coordinate in multi-environment workflows without conflict.

How do I preview schema changes before deploying to production?

Use the dry-run flag to preview all pending schema changes without applying them. This lets you validate SQL syntax, review execution order, and confirm environment-specific variables before committing changes to Snowflake.

Why should I use repeatable and always scripts instead of one-time versioned scripts?

Repeatable scripts re-execute when changed, keeping views and procedures current across environments. Always scripts run every deployment for recurring setup tasks. This layered approach eliminates manual updates and ensures idempotent, safe re-executions without side effects.