fix: always migrate before start #11

Merged
3wordchant merged 2 commits from arso/outline:dev into main 2022-08-04 14:48:25 +00:00
Member

Hi,
the current recipe failed to start for me. The app container kept dying in a loop, with errors about missing tables. Because both app run and app cmd require a running container, I couldn't run the migrate command that is mentioned in the README. A simple fix is to just always run the migrate command before starting. With this, the recipe works great for me.
Thanks,
Frando

Hi, the current recipe failed to start for me. The app container kept dying in a loop, with errors about missing tables. Because both `app run` and `app cmd` require a running container, I couldn't run the migrate command that is mentioned in the README. A simple fix is to just always run the migrate command before starting. With this, the recipe works great for me. Thanks, Frando
Frando added 2 commits 2022-08-03 20:28:34 +00:00
Author
Member

If running (potentially destructive) migrate commands on each start is considered bad practice, it could be toggled via an enironment variable maybe instead. I guess the migrate command can make downgrades impossible, so maybe it would be better to have it optional.

Is there a good way on how to check if the container is being started for the first time, to always run the migrate command in that case? Or it could check if the DB is empty.

If running (potentially destructive) migrate commands on each start is considered bad practice, it could be toggled via an enironment variable maybe instead. I guess the migrate command can make downgrades impossible, so maybe it would be better to have it optional. Is there a good way on how to check if the container is being started for the first time, to always run the migrate command in that case? Or it could check if the DB is empty.
decentral1se approved these changes 2022-08-04 09:33:22 +00:00
decentral1se left a comment
Owner

LGTM, let's try it! Also, would be good to patch https://git.coopcloud.tech/coop-cloud/outline#post-deploy-migration explaining that it is done for you now.

LGTM, let's try it! Also, would be good to patch https://git.coopcloud.tech/coop-cloud/outline#post-deploy-migration explaining that it is done for you now.
3wordchant merged commit 7685fe6abf into main 2022-08-04 14:48:25 +00:00
Owner

@decentral1se I agree about docs, I also observe running cmd app migrate should be a no-op. Optimistically merged

@decentral1se I agree about docs, I also observe running `cmd app migrate` should be a no-op. Optimistically merged
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: coop-cloud/outline#11
No description provided.