Skip to main content
Choose the right Git branching strategy and CI/CD patterns for your team’s workflow.

Git Branching Strategies

GitHub Flow (Simple)

Workflow:
  1. Create feature branch from main
  2. Develop migration
  3. Open PR, SQL review runs
  4. Merge to main
  5. CI creates release and deploys
Best for: Continuous deployment, small teams

GitLab Flow (Environment Branches)

Workflow:
  1. Merge to main → deploys to dev
  2. Merge main to staging → deploys to staging
  3. Merge staging to production → deploys to prod
Best for: Progressive environment promotion

Git Flow (Release Branches)

Workflow:
  1. Develop in feature branches
  2. Merge to develop → deploys to dev/staging
  3. Create release branch → final testing
  4. Merge to main → deploys to production
Best for: Scheduled releases, large teams

CI/CD Integration Patterns

Pattern 1: Automated Review + Manual Deploy

Best for: Production environments requiring manual control

Pattern 2: Fully Automated Pipeline

Best for: Dev/staging environments, high-frequency deployments

GitOps Tutorials

Complete CI/CD setup examples for GitHub, GitLab, Azure DevOps, and Bitbucket

Testing Strategies

Test in Non-Production First

Always follow environment progression:
Never skip environments for production changes.

Use Sampling for Large Fleets

For database groups with 100+ databases:
During SQL review, validates on 20 random databases for faster feedback.

Maintain Test Data

Create sample datasets that mirror production:
Test migrations against this data locally before committing.

Schema Compatibility Testing

Before deploying schema changes:
  1. Deploy new schema to staging
  2. Test old application version against new schema
  3. Verify backward compatibility
  4. Deploy application update
  5. Remove deprecated columns/tables later
This enables zero-downtime deployments.

Local Testing Workflow

Before committing:

CI Testing Checklist

Automated tests should verify:
  • ✅ SQL syntax is valid
  • ✅ Migration applies successfully
  • ✅ No SQL review rule violations
  • ✅ Schema changes don’t break existing queries
  • ✅ Performance impact is acceptable
  • ✅ Rollback script works (if provided)

Next Steps

SQL Review and Security

Configure review rules and security practices

GitOps Tutorials

Step-by-step CI/CD setup guides