sqlalchemy / sqlalchemy/alembic

CLI "Approve Migration? (y/n)"

Open
#540 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

documentation
Dominant language
Python
Stars
4.4k
Forks
375
PR merge metrics
No merged PRs in 30d

Description

Because of the potentially destructive nature of downgrading, it may be useful for the CLI to verify the migration that's going to take place on the particular database/environment. e.g.

$ alembic downgrade -1
Planned downgrade for environment PROD: 5a79c370e145 -> 42f6b68fe138, setup table ABC
Please type 'yes' to continue with migration.

An example of this would be Terraform's apply command that shows the planned changes and requires user confirmation with a yes to actually perfom. To provide compatibility for those using migrations in scripts, a CLI flag for -auto-approve could also be added.

Thoughts?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the CLI entry point for alembic downgrade -1 and trace how the migration plan is displayed and executed. Define the confirmation behavior for destructive downgrades, including the proposed -auto-approve path, and consider the existing script-compatibility requirement as the completion criteria.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, sqlalchemy
Domain
cli, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.