Question about zero downtime flow and database migrations (Laravel) #3953
-
Hi all According to workflow in the docs, database migrations for new releases are run before the new release is published and the symlinks are switched over. Which means there's a short period of time (longer if the migrations take a while...) where the old release's codebase + new release's db schema are running together. Is that correct? If so, how do people work around the problem of old code not working with new schemas? For example a new release may drop a column that the old release is still trying to use. Cheers |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
If your migration is non compatible with previous version on the code, you will have downtime. Design your migrations to be compatible and deploy ready. Some times it makes sense to split migration into two parts and deploy twice. |
Beta Was this translation helpful? Give feedback.
-
Yeah but if you're running setup upgrade the site is forced to be put into maintenance mode using the old release so I don't think it should be a problem. I don't think you can have zero down time if your configuration has changed or if you're database needs changes. |
Beta Was this translation helpful? Give feedback.
If your migration is non compatible with previous version on the code, you will have downtime.
Design your migrations to be compatible and deploy ready. Some times it makes sense to split migration into two parts and deploy twice.