[TRI-1948] Self-hosting: non-public schemas will fail on the initial db migrations
matt-aitken opened this issue · comments
A migration was accidentally added that had a hard-coded reference to "public". We can't just remove that because it will cause a mismatch between the applied migrations table hash and the migration files.
Potential fix
- Update the migration to fix it.
- Add a script that runs before
db migrate deploy
in shell startup script.- Update hash for the bad migration.
- Make that SQL available to run somewhere else, maybe in a Readme
From SyncLinear.com | TRI-1948
A temporary workaround for new docker deploys: (do NOT use for existing deploys!)
services:
triggerdotdev:
# These values may differ in your deploy
image: ghcr.io/triggerdotdev/trigger.dev:latest
container_name: triggerdotdev
restart: always
env_file:
- .env
ports:
- 3030:3030
depends_on:
- triggerdotdev-database
networks:
- app_network
# This is the important bit!
command:
- sh
- -c
- sed -i s/public/triggerdotdev/ ./packages/database/prisma/migrations/20240130165343_add_composite_index_to_job_run_for_job_id_and_created_at/migration.sql && ./scripts/entrypoint.sh