Skip to main content

Command Palette

Search for a command to run...

Prisma Note

Updated
1 min readView as Markdown
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

More from this blog

My Backend Notes

24 posts

從經濟系轉職的菜鳥後端工程師,因為很菜很菜,所以把所有的學習筆記都記錄在這裡