Skip to content

Conversation

@Khaleelhabeeb
Copy link

feat: Add support for --up flag in migration process

  • Updated migrations.py to handle the --up flag for running upward migrations.
  • Modified cli.py to include a --up flag in the migrate command, allowing users to specify migration direction.
  • Ensured that the default behavior of the inspira_migrate command is to run down migrations unless the --up flag is provided.
  • Checked for mutual exclusivity between --up and --down flags to avoid conflicting directions.

These changes allow users to easily specify migration direction using the --up flag, " inspira_migrate --up" will run up migrations
fixes issues #72

feat: Add support for --up flag in migration process

- Updated `migrations.py` to handle the `--up` flag for running upward migrations.
- Modified `cli.py` to include a `--up` flag in the `migrate` command, allowing users to specify migration direction.
- Ensured that the default behavior of the `inspira_migrate` command is to run down migrations unless the `--up` flag is provided.
- Checked for mutual exclusivity between `--up` and `--down` flags to avoid conflicting directions.

These changes allow users to easily specify migration direction using the --up flag
inspira_migrate --up will run up migrations
cicekhayri
cicekhayri previously approved these changes Apr 13, 2024
@cicekhayri cicekhayri self-requested a review April 13, 2024 05:59
@cicekhayri cicekhayri dismissed their stale review April 13, 2024 05:59

Tests failed

@Khaleelhabeeb
Copy link
Author

i think the failing test is because the teardown_migration_directory fixture might be deleting the migrations directory after each test, leading to the FileNotFoundError during test_run_migrations_down. possible solution:
If down migrations are not crucial for unit testing, consider moving the teardown_migration_directory fixture to a different scope (e.g., after all tests are complete) or create a separate fixture specifically for tests that don't require down migrations.

And all test are passing when running locally

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.

2 participants