-
Notifications
You must be signed in to change notification settings - Fork 0
CLI: enroll_db #22
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
CLI: enroll_db #22
Conversation
6c60734 to
97b032b
Compare
|
@pydanny Just to confirm: this is still in draft, but you'd like me to look at it now? |
|
@algal Still in draft, there's a regression failure I need to fix. |
|
@algal I created a new virtual environment and manual tests all now pass. So it was an issue with my local development environment, not a regression. |
|
@pydanny Hi Danny, I have reviewed this. In a Discord thread this morning (which I think you caught half of), @jph00 specified what he would like the
So I reviewed this PR based on what is needed to move toward that specification. Reviewing this PR, in particular the command behavior defined in lines L148-182 cli.py (starting at fastmigrate/fastmigrate/cli.py Line 148 in 53f39fa
In order to fit Jeremy's spec, I'd suggest the following changes.
@jph00: Please let us know if this sounds off-base to you, based on our discussion. |
algal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added comments in conversation, on my recommendation for changes to simplify this based on Jeremy's spec for enroll_db.
|
Thanks @algal . My main request is to remove nearly all the code from this PR -- aim for under a dozen lines (not including docments et al - just counting actual logic). I prefer not to have private APIs where possible. But if the CLI just calls the API directly, that should keep things consistent IIUC. |
|
To keep things simple on my end, I've started a new branch. The PR for that branch is here. |
|
Hey @algal and @jph00, thanks so much for the reviews and feedback! Looking at this PR now I see in hindsight the scope got way too large. I've extracted, recoded and rewritten the PR as #23, focusing on the changes you requested. Thanks to the schema code I did have to go over the requested line count. The issue there is making sure the initial migration is guaranteed to work on an existing SQLite db. I'm keen to learn of any methods I can use to cut down the line count further. Closing this now as the work is now taking place in #23. |
This PR adds a CLI command for enrolling a DB, which also does its best to add an initial migration. After a warning the user can reject the initial migration through the dialogue.
If the user wishes to force the CLI to skip the querying, they can use the
--forceflag.enroll_dbfunction, evolving from_ensurefuncenroll_dbandget_db_schema