ballers-prisma-prod
v1.0.14
Published
Package for Ballers Prod app
Downloads
220
Readme
Setup Database Connection
Run bastion host on port 3308 before executing Prisma commands:
ssh -i ~/.ssh/ballers-prod-bastion.pem -L 3308:ballers-prod-cluster.cluster-c3s6wi4sy59y.eu-north-1.rds.amazonaws.com:3306 [email protected] -f -N -o ServerAliveInterval=60 -o ServerAliveCountMax=10 -o TCPKeepAlive=yes -o ExitOnForwardFailure=yes
Generate Prisma files
npx prisma generate
Migrate prisma files
Stage-only steps (safe workflow)
- Edit
schema.prisma. - Create a new migration folder: #TODO: Change the "20260525_ballers_migration_prod_1" to your new folder name
mkdir -p migrations/20260525_ballers_migration_prod_1- Generate the SQL diff: #TODO: Change the "20260525_ballers_migration_prod_1" to your new folder name
npx prisma migrate diff \
--from-config-datasource \
--to-schema ./schema.prisma \
--script \
--config ./prisma.config.ts \
> migrations/20260525_ballers_migration_prod_1/migration.sql- Review the generated SQL:
cat migrations/20260525_ballers_migration_prod_1/migration.sql- Apply the SQL to the database:
npx prisma db execute --config ./prisma.config.ts --file migrations/20260525_ballers_migration_prod_1/migration.sql- Mark the migration as applied:
npx prisma migrate resolve --applied 20260525_ballers_migration_prod_1 --config ./prisma.config.ts- Confirm migration status:
npx prisma migrate status --config ./prisma.config.tsNotes for stage env
- Use a new folder name for each schema change.
- Keep old migration folders; they are the applied history.
- Do not delete old migrations unless you know what you are doing.
- If
prisma migrate statussaysDatabase schema is up to date!, your migration history and database are consistent.
After logging in with the npm try runing this command to publish on npm
npm publish --access=public
