prisma/schema.prisma file:
fly launch will create a PostgreSQL database suitable for development.
For production, see Fly.io Managed Postgres.
Dockerfile
If your application does not have aDockerfile, fly launch will create a Dockerfile for you.
If at a later time you would like to replace your Dockerfile, you can do so by running:
Migrations and seeds
prisma migrate will be run on every deploy, applying the migrations found in yourprisma/migrations directory against your production database. The command to be run is
controlled by your fly.toml:
package.json, it will be run once, at fly launch time,
immediately after the first migration.
Conversion from SQLite
Converting from SQLite starts by updating yourprisma/schema.prisma to match what you see at the top of this post. Next, remove all your existing migrations in your prisma/migrations directory and recreate them:
[processes] and [mounts] sections from the fly.toml and add the [deploy] section you see above.
Download your existing SQLite database and use pgloader to convert it to postgres:
fly postgres import.
Set the DATABASE_URL secret using fly secrets set.
Run fly deploy.
Once you are up and running, you can delete your volume using fly volumes destroy.