Remove auto-enhance of db:migrate with install:migrations#87
Merged
HamptonMakes merged 1 commit intomainfrom Apr 7, 2026
Merged
Remove auto-enhance of db:migrate with install:migrations#87HamptonMakes merged 1 commit intomainfrom
HamptonMakes merged 1 commit intomainfrom
Conversation
The enhance causes db:migrate to try copying engine migration files into the host's db/migrate/ directory before running. In deployed containers with a read-only filesystem this fails with Errno::EROFS, preventing migrations from running and causing health check failures. Host apps should copy engine migrations explicitly when bumping the gem version: bin/rails co_plan:install:migrations bin/rails db:migrate Amp-Thread-ID: https://ampcode.com/threads/T-019d69ae-2fa0-7436-9583-06479ace64c7 Co-authored-by: Amp <amp@ampcode.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The engine's
coplan.rakeenhancesdb:migratewithco_plan:install:migrationsas a prerequisite. This causesdb:migrateto try copying engine migration files intodb/migrate/before running.In deployed containers (staging/production) the filesystem is read-only, so this fails with
Errno::EROFS, abortingdb:migrateentirely. Pending migrations never run → health check returns 500 → deploy never goes healthy.Fix
Remove the enhance. Host apps should copy engine migrations explicitly when bumping the gem:
A CI spec is being added to
coplan-squareto catch any forgotten copies.Context
This was blocking the staging deploy of coplan-square: https://console.sqprod.co/app/coplan-square/deploy/cloud-cd/kube