-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
implement alembic to handle database migrations #2317
Conversation
I do need to figure out how to automatically run Alembic for new versions of Sopel 🤔 |
That'd be cool. I'm not clear on how this works with packaged installs vs. being installed from Git, because the version appears based on commit SHAs, but also haven't read this whole patch yet (nor read Alembic docs). Maybe later when I'm not out and on a phone. 😁 |
As said on IRC, I'm sorry I've to say no, because I've been there, I've done the work on previous project so I know what it means. However when we want migrations in Sopel:
Basically, we don't need the default behavior of Alembic, which is to run for a project you 100% control, we need a system closer to what Django's ORM support: generate migrations for your project, package it, then collect all migrations from the project and its installed plugin to run them. And trust me, I know it's not easy, I had to done it once a few years ago and it wasn't fun at all. As a side note, the migration needs to have a complete downgrade handler, this one is incomplete. |
There's definitely a way to package this within the application itself to migrate on boot / startup, since this is functionality that Flask-Migrate has, so it must be possible. |
I know there is a way: I've done it. I also know this PR is not the way. |
I'm open to other suggestions |
Description
Implement Alembic to handle current and future database migrations
Checklist
make qa
(runsmake quality
andmake test
)