Rename a table
In
schema.prisma
file, rename the modelrun
prisma migrate dev --create-only
andy
, this cli would not run this created migration file immediatelyname 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