Declarative Multi-Environment Database Schema & Migration Tooling
An events / badge-management platform
Overview
A declarative, schema-as-code toolkit for the events / badge-management platform’s PostgreSQL database, using Atlas to manage and migrate the schema safely across local, staging, and production environments.
The Challenge
Coordinating database changes across multiple environments is error-prone, and an events/badge domain has interrelated entities (events, members, badges, devices, scans, evacuees) that must evolve together without risking production data.
What We Built
An Atlas-driven workflow defining the schema as HCL files, events, members, badges, badge_scans, devices, evacuee, evacuee_scans, and public, with atlas.hcl environment configuration. Parallel Python and Bash CLIs plus a Makefile expose per-environment commands for diff, apply, status, inspect, lint, and validate (local/staging/prod), with production safeguards against destructive operations. A Dockerized local Postgres, a Jest + pg test suite, and documentation (QUICKSTART, WORKFLOW, TESTING) round out the workflow.
Technologies & Approach
Atlas for declarative schema management and migration generation; HCL to express the data model; environment-scoped npm/Make/Python/Bash commands for a consistent, safe migration workflow; Docker for an ephemeral local database. The dual-CLI design lets engineers work in whichever runtime they prefer.
Outcome / Impact
Gave the team a repeatable, auditable way to evolve the schema with guardrails against unsafe production changes, turning database migrations into a versioned, reviewable process rather than ad-hoc SQL.
Capabilities Demonstrated
- Declarative schema-as-code with Atlas
- Safe, multi-environment migration workflows with production safeguards
- Versioned, testable database change management