Conversation
…grate Update davecgh/go-spew from v1.1.1 to v1.1.2-0.20180830191138-d8f796af33cc and pmezard/go-difflib from v1.0.0 to v1.0.1-0.20181226105442-5d4384ee4fb2 for latest upstream fixes. Upgrade go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp from v0.60.0 to v0.61.0. Add github.com/golang-migrate/migrate/v4 v4.19.1 as indirect dependency for database migration support.
… with separate up/down files for bidirectional schema changes Rename migration files from sequential numbering (001_*.sql) to golang-migrate timestamp format (20240429000001_*.up.sql) for version ordering. Add corresponding .down.sql files for each migration containing DROP statements in reverse dependency order with trigger/function cleanup before table drops. Maintain original schema definitions in .up.sql files unchanged.
…for bidirectional migration support and improved version control Remove custom Migrate function and schema_migrations table management from database/migrate.go. Replace with golang-migrate/migrate/v4 library in cmd/migrate/main.go supporting up/down/version actions with optional step count. Add database URL construction from config and migrate instance creation with file source. Implement action switch handling Up/Down/Steps/Version operations
…with step control for bidirectional schema management Replace single migrate target with migrate-up/migrate-down/migrate-version targets supporting golang-migrate actions. Add migrate-down with -steps 1 flag for single-step rollback and migrate-version for current schema version display. Update .PHONY declarations and dev-setup to use migrate-up. Retain legacy migrate target as alias to migrate-up for backward compatibility.
…ensure database schema is up-to-date Add migrate tool build step and database migration execution to CI workflow before running tests. Build migrate binary to bin/migrate from cmd/migrate and execute migrations with up action using test database credentials (localhost:5432/betting_test). Configure DATABASE_* environment variables for migration connection and set migrations directory to ./migrations.
…d remove golangci-lint v2 config options Downgrade golangci-lint from v1.58.0 to v1.55.2 in CI workflow for compatibility. Correct gosec installation path from securecodewarrior/gosec to securego/gosec in security workflow. Remove go version specification and default: none directive from .golangci.yml as these are not supported in golangci-lint v1 configuration format.
…nstead of manual installation Replace manual Go setup and gosec installation steps with securego/gosec@master GitHub Action. Pass exclude-dir argument directly to action with args parameter to maintain tests directory exclusion while reducing workflow complexity.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR replaces the custom database migration implementation with the industry-standard golang-migrate library, providing production-ready features like up/down migrations, database locking, and rollback capabilities.
Changes
Migration Infrastructure
Build & Automation
Documentation
Benefits
Migration Commands
Testing
All existing migrations have been converted and tested. The CI/CD pipeline now runs migrations automatically before executing tests to ensure database schema is up-to-date.