Prisma Note

Photo by Evie S. on Unsplash

Prisma Note

Rename a table

  • In schema.prisma file, rename the model

  • run prisma migrate dev --create-only and y, this cli would not run this created migration file immediately

  • name this created migration file

  • run npx prisma migrate dev to operate the created migration file

    • Note: this operation would drop the table which means all the data on this table would be removed
  • now the previous name of the model has been changed to the new one (expenseRecord to record), regenerate the seed data npx prisma db seed

  • check database npx prisma studio