THREESCALE-14262 - deploy runs seed on empty database#4265
THREESCALE-14262 - deploy runs seed on empty database#4265akostadinov merged 1 commit into3scale:masterfrom
Conversation
jlledom
left a comment
There was a problem hiding this comment.
Haven't tested. But I trust you
|
I have tested with configuration where master password was set to invalid value and the seed was failing, but a re-run of the deploy task simply passed without an issue: Run 1: Run 2: What I expected was the run 2 to re-try the migration and keep failing until I fix the password. |
|
@urbanikb I will try to replicate locally exactly what you have done to replicate because simulated failure locally showed me the correct result. Could you just positively check you are running the correct image :) |
Thanks for the prompt - the image that ran was indeed |
|
False alarm - the test with the actual image works as expected, subsequent runs error out. Run 1 Run 2+ |
If seeding fails for example because seed password was weak, then currently for a customer it would be a mess to recover from this situation. They will need to clear the database completely.
Not we detect empty database and run the seed on startup.
My tests show that original behavior doesn't change.
I notice a problem though, the code reads to me as if it should work even if the database (not the server, just the database) is not created yet and will try to create. But on postgres at least, if database doesn't exist,
db:deployfails. This is no change from current behavior though so I'm leaving it for another life.