Hello everyone! I have been trying to wrap my head...
# orm-help
n
Hello everyone! I have been trying to wrap my head around how to use prisma in production. The documentation that I found is rather confusing with the migrations. This is what I want to achieve. 1. production database with prisma! 2. added new table locally 3. created migration using
db pull
4. added script that runs
npx prisma migrate deploy
on deploy 5. deploy new migration on production 📛 I get the following error:
Copy code
Error: P3009

migrate found failed migrations in the target database, new migrations will not be applied. Read more about how to resolve migration issues in a production database: <https://pris.ly/d/migrate-resolve>
The `20220503190343_multichat` migration started at 2022-05-19 23:57:48.448 UTC failed with the following logs:
Looking into the migration that was generated it added steps that are not necessary. How would I create a migration when developing. As in how would I create a migration from STATE1 to STATE2 without the ORIGINAL_DB_STATE. So the migration only includes the last changes done to the DB (in my case adding a table). As
db pull
does not seem to be the answer because it creates a full migration from 0. If anyone could link me to a dev workflow with prisma that would really help
r
Hi @Norbert Takács - this may not solve your issue but don't forget that you can generate the migration file and then edit the actual SQL before running it (in the prisma/migrations/xxx folder).