{"repo":"tuliren/prisma-template","free":true,"listed":false,"github":"https://github.com/tuliren/prisma-template","clone":"git clone https://github.com/tuliren/prisma-template.git","description":"Prisma template with better rollback functionality","language":"Shell","stars":13,"topics":["migration","prisma","rollback","template"],"license":"MIT","category":"databases-storage","readme_excerpt":"Prisma Template This is a Prisma template with better migration rollback support. Native Prisma migration system has limited rollback functionality: - A separate command is required to create a down migration. - It can only roll back a migration when the migration fails. See documentation here for details. Of course, down migrations should not be used in production. However, it is a common operation during development. When working on database schema change, one can seldom get everything right the first time. And it is undesirable to create multiple migrations for a single schema change, or to manually edit the migration files and database schema to fix the mistake. The golden migration experience is from Rails, in which one can always create an up migration and a down migration for each schema change. During development, when a mistake is made, just rollback the last migration and write a new one. This template aims to provide a similar experience for Prisma as follows: - Create a rollback SQL script for each migration. - Add a rollback command to roll back the last migration. - Add a schema dump command to pull the current schema from the database, and persist it to prisma/schema dump.sql . Commands Command Description --- --- yarn db:check-drift Check the difference between the schema in the database vs in the Prisma schema file. yarn db:create-migration Create a new migration, together with the rollback script. yarn db:deploy Apply the migration, and update the schema dum","default_branch":null,"files":null,"tree":[],"storefront":"/r/tuliren","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/tuliren/prisma-template/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}