{"id":51146485,"url":"https://github.com/nathanthorell/migwatch","last_synced_at":"2026-06-26T03:02:11.115Z","repository":{"id":367200970,"uuid":"1276985055","full_name":"nathanthorell/migwatch","owner":"nathanthorell","description":"A terminal dashboard for monitoring database migration state across environments.","archived":false,"fork":false,"pushed_at":"2026-06-25T00:57:31.000Z","size":69,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-25T02:13:33.860Z","etag":null,"topics":["database-migrations","golang","mssql","sql"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nathanthorell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-22T13:27:33.000Z","updated_at":"2026-06-25T00:57:34.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/nathanthorell/migwatch","commit_stats":null,"previous_names":["nathanthorell/migwatch"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/nathanthorell/migwatch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanthorell%2Fmigwatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanthorell%2Fmigwatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanthorell%2Fmigwatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanthorell%2Fmigwatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nathanthorell","download_url":"https://codeload.github.com/nathanthorell/migwatch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanthorell%2Fmigwatch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34801014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-26T02:00:06.560Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database-migrations","golang","mssql","sql"],"created_at":"2026-06-26T03:02:10.408Z","updated_at":"2026-06-26T03:02:11.038Z","avatar_url":"https://github.com/nathanthorell.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# migwatch\n\nmigwatch is a CLI tool for visualizing database migration state across environments. It connects directly to your databases and displays migration history from your migration tool's schema history table.\n\n## Quick Start\n\n1. **Copy example files**:\n\n   ```bash\n   cp .env.example .env\n   cp migwatch.toml.example migwatch.toml\n   ```\n\n2. **Edit `.env`** with your database connection strings\n\n3. **Edit `migwatch.toml`** with your environment definitions\n\n4. **Run**:\n\n   ```bash\n   # Show summary for all environments (default)\n   ./migwatch\n\n   # Compare migration state across all environments\n   ./migwatch compare\n\n   # Show full migration history table\n   ./migwatch full\n\n   # Filter to a specific environment\n   ./migwatch --env dev\n   ./migwatch full --env dev\n   ```\n\n## Configuration\n\n### Project Structure\n\n```none\n├── /\n├── main.go                      # App entry point\n├── cmd/                         # CLI commands\n│   ├── root.go                  # Command definition and flags\n│   ├── helpers.go               # Shared helpers (fetch, banner, env label)\n│   ├── run_summary.go           # migwatch / migwatch summary\n│   ├── run_full.go              # migwatch full\n│   └── run_compare.go           # migwatch compare\n├── config/                      # Configuration management\n│   ├── config.go                # TOML types and loading\n│   ├── environments.go          # EnvironmentConfig type and ordered env access\n│   ├── conn.go                  # DSN parsing and connection building\n│   └── auth.go                  # Token resolution and auth error wrapping\n├── model/\n│   └── models.go                # Shared types\n├── provider/\n│   ├── provider.go              # MigrationProvider interface\n│   └── flyway/\n│       └── flyway.go            # Flyway implementation\n├── display/\n│   ├── display.go               # Banner and environment header output\n│   ├── styles.go                # Lipgloss style definitions\n│   ├── table.go                 # Styled table output\n│   ├── summary.go               # Per-environment summary output\n│   └── compare.go               # Multi-environment comparison table\n├── migwatch.toml                # App config (gitignored)\n├── migwatch.toml.example        # Example config\n├── .env                         # Connection strings (gitignored)\n└── .env.example                 # Example environment file\n```\n\n### Application Configuration\n\nConfiguration is managed through `migwatch.toml`. Each environment block references a `.env` variable by name and sets provider-specific options:\n\n```toml\n[environments.dev]\nname     = \"Dev\"\ndsn_env  = \"DEV_DSN\"\nprovider = \"flyway\"\nschema   = \"dbo\"\ntable    = \"flyway_schema_history\"\n\n# multiple schemas on the same database\n[environments.dev_multi]\nname     = \"Dev\"\ndsn_env  = \"DEV_DSN\"\nprovider = \"flyway\"\nschemas  = [\"dbo\", \"dba\"]\ntable    = \"flyway_schema_history\"\n\n# database override: one shared DSN, different database per environment\n[environments.staging]\nname     = \"Staging\"\ndsn_env  = \"DEV_DSN\"\nprovider = \"flyway\"\ndatabase = \"stagingdb\"\nschema   = \"dbo\"\ntable    = \"flyway_schema_history\"\n```\n\n### Authentication (SQL Server)\n\nConnection strings go in `.env`. Use the `fedauth` parameter to select the auth method:\n\n```env\n# SQL auth\nDEV_DSN=sqlserver://user:pass@myserver?database=mydb\n\n# Entra - az login token\nDEV_DSN=sqlserver://myserver.database.windows.net?database=mydb\u0026fedauth=ActiveDirectoryAzCli\n\n# Entra - interactive browser\nDEV_DSN=sqlserver://myserver.database.windows.net?database=mydb\u0026fedauth=ActiveDirectoryInteractive\n\n# Entra - default credential chain\nDEV_DSN=sqlserver://myserver.database.windows.net?database=mydb\u0026fedauth=ActiveDirectoryDefault\n```\n\nInteractive auth also requires `AZURE_CLIENT_ID` in `.env` - see `.env.example` for the default value.\n\n### Authentication (PostgreSQL)\n\n```env\n# Password auth\nDEV_DSN=postgres://user:pass@myserver:5432/mydb?sslmode=disable\n\n# Entra - az login token (Azure Flexible Server)\nDEV_DSN=postgres://user%40example.com@myserver.postgres.database.azure.com/mydb?sslmode=require\u0026fedauth=ActiveDirectoryAzCli\n\n# Entra - default credential chain (Azure Flexible Server)\nDEV_DSN=postgres://user%40example.com@myserver.postgres.database.azure.com/mydb?sslmode=require\u0026fedauth=ActiveDirectoryDefault\n```\n\nNote: the `@` in the username should be percent-encoded as `%40` - both forms work, but `%40` is safer and standards-compliant.\n\n## Building and Running\n\n```bash\n# Build the application\ngo build -o ./build/migwatch .\n\n# Show summary for all environments (default)\n./build/migwatch\n\n# Compare migration state across all environments\n./build/migwatch compare\n\n# Show full migration history table\n./build/migwatch full\n\n# Filter to one environment\n./build/migwatch --env dev\n./build/migwatch full --env dev\n\n# Use a custom config or env file\n./build/migwatch --config /path/to/migwatch.toml --env-file /path/to/.env\n```\n\n## Commands\n\n- `migwatch` / `migwatch summary` - Summary view: last migration, total count, failures per environment\n- `migwatch compare` - Multi-environment comparison table: latest version and repeatable checksums per env, color-coded by value match\n- `migwatch full` - Full migration history table per environment\n\n## Flags\n\n- `-e, --env \u003cname\u003e` - Filter output to a single environment\n- `--config \u003cpath\u003e` - Path to config file\n- `--env-file \u003cpath\u003e` - Path to `.env` file\n- `-h, --help` - help for migwatch\n\n## Contributing\n\nThis is a work in progress. Contributions and suggestions are welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathanthorell%2Fmigwatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnathanthorell%2Fmigwatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathanthorell%2Fmigwatch/lists"}