RedHatInsights / insights-api-common-rails

Header, Encryption, RBAC, Serialization, Pagination and other common behavior for Insights microservices built with Rails
Apache License 2.0
3 stars 25 forks source link

Let's talk about migrations... #146

Open bdunne opened 4 years ago

bdunne commented 4 years ago

Scenario: You have an app running. You create some new migrations and change code to depend on those migrations. During the new deploy, migrations fail. What should happen?

Migration 1: add a new column (unlikely to fail)

Migration 2: move data from an old column into the new column (most likely to fail)

Migration 3: delete the old column (unlikely to fail)

Should we make the API pod fail to start if migrations fail? If seed fails?

bdunne commented 4 years ago

I think it should fail to start the rails server if migrations fail.

lindgrenj6 commented 4 years ago

I agree with @bdunne, I'm a big fan of having the pod fail x times and go into the CrashLoopBackoff state rather than coercing the user into thinking everything is mostly ok when the database hasn't been migrated.