ballers-prisma
v1.0.40
Published
Package for Ballers app
Readme
Setup Database Connection
Run bastion host on port 3307 before executing Prisma commands.
Generate Prisma files
npx prisma generate --config ./prisma.config.ts
Prisma migration commands
Stage-only steps (safe workflow)
- Edit
schema.prisma. - Create a new migration folder: #TODO: Change the "ballers_migration_stage_02" to your new folder name
mkdir -p migrations/20260526_ballers_migration_stage_03- Generate the SQL diff: #TODO: Change the "ballers_migration_stage_01" to your new folder name
npx prisma migrate diff \
--from-config-datasource \
--to-schema ./schema.prisma \
--script \
--config ./prisma.config.ts \
> migrations/20260526_ballers_migration_stage_02/migration.sql- Review the generated SQL:
cat migrations/20260526_ballers_migration_stage_02/migration.sql- Apply the SQL to the database:
npx prisma db execute --config ./prisma.config.ts --file migrations/20260526_ballers_migration_stage_02/migration.sql- Mark the migration as applied:
npx prisma migrate resolve --applied 20260526_ballers_migration_stage_02 --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
