Issues with Drizzle orm Migrations

Im trying to run drizzle-kit push:sqlite this command which is meant to create the necessary tables but It never does. I even try to run the command using fly ssh console but it just closes after a few seconds.

Would appreciate some help with this.
Running the Dockerfile on its own works but not during fly deploy.

Heres the command in the docker file. This is the final stage of the build. The migrations are created during the build stage

# Ensure our mount & data directories exists before mounting.
RUN mkdir -p /data
RUN npm run db:push # package.json script to run the command

CMD ["npm", "start"]

Hi, a RUN will execute at build-time, and will therefore not have access to secrets, nor does it run on one of your actual machines and has no access to the volumes or database.

This sounds like you want to run a “one-off command during the deploy”, which is how migrations are typically run - if so, you probably need to remove that part of your Dockerfile and use a release_command instead:

Thank you

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.