renaming column names
Hello,
In the past I've made some really bad naming decisions for my columns and I'm wanting to rename these now.
current schema:
I would like to rename the
botStatusType
column to botActivityType
. To do this I tried using the @map property, below is an example of how i tried this:
My database is populated full of data which cannot be removed, id like this schema change to be seemless, but when attempting to prisma db push
I get the following error:
2 Replies
You chose to debug with a human. They'll tinker with your query soon. If you get curious meanwhile, hop into
#ask-ai
for a quick spin!IMO you have two good options:
- modify the generated migrations to be column renames instead of the delete/create pairs.
- use the expand and contract pattern docs
How to migrate data with Prisma ORM using the expand and contract p...
Learn how to perform data migrations using the expand and contract pattern with Prisma ORM