Repository navigation
Ship the Postgres migrations in the image, not the SQLite ones - #133
Merged
Merged
Conversation
The Dockerfile copied packages/storage/migrations (SQLite) to /api/migrations and start.sh ran them against the production Postgres. Every file was skipped only because its name matched a migrations-pg row in schema_migrations; the next new migration would have run SQLite SQL against prod. - Dockerfile copies migrations-pg to /api/migrations-pg and fails the build if any file lacks the "-- TronBrowser Postgres schema:" header. - start.sh points MIGRATIONS_DIR at /api/migrations-pg. - db-migrate.mjs logs the folder it reads and refuses, before touching the database, a Postgres target whose folder holds non-Postgres migrations. - CI asserts that refusal on the SQLite folder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
ThreatCrush Security Scan52 finding(s) HIGH/CRITICAL: 3 | MEDIUM: 28 | LOW: 21
…and 2 more. Full results in the Security tab. Snippets are redacted; ThreatCrush never prints matched credential material. |
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.
The API image copied
packages/storage/migrations(SQLite) to/api/migrations, andstart.shapplied it to the production Postgres on boot. Today every file is skipped only because its filename matches amigrations-pgrow inschema_migrations; the next new migration would run SQLite SQL against prod.migrations-pgto/api/migrations-pgand fails the build if any file lacks the-- TronBrowser Postgres schema:header.start.shsetsMIGRATIONS_DIR=/api/migrations-pg.db-migrate.mjslogs which folder it reads, and on a Postgres target refuses (before any query) a folder holding non-Postgres files.Tested locally on a throwaway postgres:16: the SQLite folder is refused with exit 1, the pg folder applies 7 and is idempotent on rerun; the Dockerfile check passes on migrations-pg and fails on migrations.
🤖 Generated with Claude Code