-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Run database migrations after pulling changes #377
Run database migrations after pulling changes #377
Conversation
Will that work? |
After all these years! Nice to see this finally happening. Not to say I would've done this years ago, but... I'd have done this years ago.
Hard to say, testing this code section is a bit hard. I did run a manual alembic.command.downgrade(alembic.config.Config('alembic.ini'), '426e0b848d77')
alembic.command.upgrade(alembic.config.Config('alembic.ini'), 'head') which worked just fine (except one unrelated issue, see below). I don't see why it wouldn't in the celery task. Also while running this on a new table, I realized that the new primary key of Not a huge bug, it's unlikely that someone downgrades newly created databases except for testing, but it's nice to have things consistent. Do you want to add this to this PR, since we're already in the area of db migrations? |
2b2bc27
to
d3f1d20
Compare
Good catch, fixed. |
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.
We'll only find out whether it works once we try it out on alpha, so let's give it a go.
As far as I can tell it worked perfectly after merging #374:
|
Motivation
After #369 was merged, the alpha server was left in a semi-functional state because its alembic migration wasn't executed. This command fixed it (I used the migration id in place of
head
, but I want to document the best version of it):This happens automatically when you run
./start-server.sh
, via./spacedock database migrate
:SpaceDock/start-server.sh
Line 34 in ebb54cb
... which does this:
SpaceDock/spacedock
Lines 12 to 15 in ebb54cb
SpaceDock/spacedock
Lines 75 to 79 in ebb54cb
Changes
Now after the web hook pulls changes from GitHub, and before it restarts the sever, it also tries to run the alembic migrations.