Skip to content

feat: add automated migrations pipeline and testing tools#151

Draft
jakebromberg wants to merge 2 commits intofeature/account-setup-email-capabilitiesfrom
feature/automated-migrations-pipeline
Draft

feat: add automated migrations pipeline and testing tools#151
jakebromberg wants to merge 2 commits intofeature/account-setup-email-capabilitiesfrom
feature/automated-migrations-pipeline

Conversation

@jakebromberg
Copy link
Member

@jakebromberg jakebromberg commented Feb 12, 2026

Summary

  • Automate database migrations in the deployment pipeline
  • Add migration testing and analysis tools (linting, rollback generation, snapshot testing, estimation)
  • Add performance indexes on frequently-queried foreign key columns
  • Fix orphaned migration file tracking

Stacked on #150 (account setup email + capabilities). Split from #144 for easier review.

Note: ~8,200 of the additions are auto-generated Drizzle ORM snapshot files.

Test plan

  • Verify migrations run automatically during deployment
  • Verify migration linting catches common issues
  • Verify rollback scripts are generated correctly
  • Verify snapshot tests detect schema drift

@jakebromberg jakebromberg force-pushed the feature/account-setup-email-capabilities branch from 60b7e55 to 1b9c0d5 Compare February 12, 2026 21:57
Jake Bromberg added 2 commits February 12, 2026 13:57
- Add database indexes for frequently-queried columns:
  - flowsheet: show_id, album_id, rotation_id
  - show_djs: composite (show_id, dj_id) and dj_id
  - bins: dj_id, album_id

- Add migration infrastructure to CI/CD:
  - Dockerfile.migrate for running drizzle-kit migrations
  - run-migrations GitHub Action
  - Migration jobs in deploy-base.yml workflow
  - Migrations tagged by count (e.g., migrate:0028)

- Fix orphaned migration file:
  - Rename 0024_anonymous_devices.sql to 0028
  - Add missing journal entry and snapshots
Add comprehensive migration testing infrastructure:

- Static analysis (lint-migrations.js): Detects dangerous patterns
  like missing CONCURRENTLY, NOT NULL without DEFAULT, missing
  IF NOT EXISTS guards, and destructive operations

- Rollback generator (generate-rollback.mjs): Auto-generates rollback
  SQL scripts from migrations with risk assessment and data loss warnings

- Runtime estimation (estimate-migration.mjs): Estimates migration
  duration based on table sizes and operation types

- Snapshot testing scripts: Create, load, and test migrations against
  production-like schema snapshots

- Weekly CI workflow (migration-snapshot-test.yml): Automated testing
  against production snapshots every Sunday

- CI integration: Added migration linting to PR checks

Includes rollback files for migrations 0000-0028.
@jakebromberg jakebromberg force-pushed the feature/automated-migrations-pipeline branch from c209f9f to ec2d7f5 Compare February 12, 2026 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant