Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TRI-1948] Self-hosting: non-public schemas will fail on the initial db migrations #1026

Open
matt-aitken opened this issue Apr 12, 2024 · 1 comment
Milestone

Comments

@matt-aitken
Copy link
Member

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

@matt-aitken matt-aitken self-assigned this Apr 12, 2024
@nicktrn
Copy link
Collaborator

nicktrn commented Apr 12, 2024

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

@matt-aitken matt-aitken added this to the v.42 milestone Apr 14, 2024
@matt-aitken matt-aitken removed their assignment Apr 19, 2024
@matt-aitken matt-aitken modified the milestones: v.42, v.43, v.44 Apr 21, 2024
@matt-aitken matt-aitken modified the milestones: v.44, v.45, v.46 May 5, 2024
@matt-aitken matt-aitken modified the milestones: v.46, v.47 May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants