-
-
Notifications
You must be signed in to change notification settings - Fork 189
added openadapt.renew #207
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
Conversation
src | ||
.DS_Store |
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.
I always have to ignore the .DS_Store file on Mac 😅
openadapt/renew.py
Outdated
db = getenv_fallback("DB_FNAME") | ||
if os.path.exists(db): | ||
os.remove(db) | ||
result = run(["alembic", "upgrade", "head"], stderr=PIPE, text=True) |
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.
prevents duplicate logging of config
should have probably commented the code 🥲
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.
Please do!
Thanks @0dm ! @Mustaballer is working on something similar for exporting databases, perhaps it makes sense to consolidate this logic (perhaps not). Can you please move |
new usage: |
@abrichr ready again |
implemented in #135 |
nevermind, there's a small change that needs to be merged (use config.DB_FPATH rather than getenv_fallback) |
added openadapt.renew
purpose: removes existing database file and runs alembic migrations
usage:
python3 -m openadapt.renew
I find this pretty useful and like it more than typing
rm openadapt.db && alembic upgrade head
- and it's more pythonic..I also added a definition for DB_FNAME because my linter was reporting an issue here: