Opened 9 years ago
Closed 9 years ago
#5413 closed defect (fixed)
Make models on clean database with alembic, not from models.py
Reported by: | Jessica Tallon | Owned by: | |
---|---|---|---|
Priority: | blocker | Milestone: | 0.9.0 |
Component: | programming | Keywords: | database, migrations, alembic |
Cc: | Christopher Allan Webber, Boris Bobrov | Parent Tickets: |
Description
Currently, when there is a new database with nothing that has been done, we skip all the sqlalchemy-migrate migrations and just make the models based off models.py, we then run the alembic migrations. This actually causes problems when we start doing structural changes in alembic as they have already been done in models.py so when the alembic migrations run, they error.
One solution could be to skip all the alembic migrations, however, I think a better solution is to not make any models off models.py and instead make the initial alembic migration create all the models in the state they're in right now and use alembic migrations to change them in the future, removing all of the code to construct models from model.py.
Change History (3)
comment:1 by , 9 years ago
comment:2 by , 9 years ago
comment:3 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
There we go... it's merged at last! I tested as well as I could and pushed. See the docs... there are a lot of changes to how things work...
I agree we need this, but this is tricky, because we currently don't have a solution for alembic migrations with plugins... see #5424.