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

Add Support for --up Flag in Migration Process #79

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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.

None yet

2 participants