Closed jchristgit closed 2 years ago
I'm unassigning myself for now. It should not be a lot of work, but I'm not sure how soon I'll have time.
If it's up for grabs I would love to help. If not.. I'll just leave my suggestion here anyways
After some research I found a library SQLAcodegen that works just like reflecting the current database in SQLAlchemy, except it actually generates the models. (As an additional bonus, it produces a PEP 8 compliant code). This way the API doesn't have to reflect the database every time the it starts up. Naturally, it would still require a review to make sure everything's generated properly, but it would make a whole lot easier to setup an alembic project and perform the migrations. (That's just a suggestion that I found to be convenient)
That's a good approach. In in favour.
From what I remember, the package does sometimes produce table classes instead of models (for non-trivial situations). Still, it should get us 90% of the way there, and we probably convert those tables manually.
The end goal was always to have a solid base migration that we can then use as the basis for future migrations. This means that @jb3 doesn't have to be our human migration manager.
I'm glad! 👍 Shall I open a new issue to keep things consistent?
Here's the issue #16
Set up the Alembic project for migrating the database, and create an initial migration to bootstrap the database based on the current API database schema.