Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dbmate migration running and testing tool #1316

Open
wants to merge 19 commits into
base: develop
Choose a base branch
from
Open

Conversation

samrose
Copy link
Contributor

@samrose samrose commented Nov 8, 2024

What kind of change does this PR introduce?

A tool to handle running newly created migrations, and exporting schema.sql per version of postgres.

Generated schema-.sql is used in DB test CI to check a schema dump with the file that is committed to db after running this tool. The same tool is used to run the test. The tool also runs an idempotency check after migration dump.

This tool uses https://github.com/DarthSim/overmind process manager to start/stop postgres to more cleanly manage running processes on the machine.

Also, updated docs, and slim down what is performed in test.yml, to checking idempotency and schema.sql checked in to git, as we already do the rest of the unit tests in testinfra

nix run .#dbmate-tool -- --help        
Usage: nix run .#dbmate-tool -- [options]

Options:
  -v, --version [15|16|orioledb-17|all]  Specify the PostgreSQL version to use (required defaults to --version all)
  -p, --port PORT                    Specify the port number to use (default: 5435)
  -h, --help                         Show this help message

Description:
  Runs 'dbmate up' against a locally running the version of database you specify. Or 'all' to run against all versions.
  NOTE: To create a migration, you must run 'nix develop' and then 'dbmate new <migration_name>' to create a new migration file.

Examples:
  nix run .#dbmate-tool
  nix run .#dbmate-tool -- --version 15
  nix run .#dbmate-tool -- --version 16 --port 5433

@samrose samrose marked this pull request as ready for review November 12, 2024 00:56
@samrose samrose requested a review from a team as a code owner November 12, 2024 00:56
@samrose samrose changed the title WIP Sam/dbmate schemas dbmate migration running and testing tool Nov 12, 2024
Copy link

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