PrismaP
Prisma12mo ago
18 replies
hari_narayan

Migration issue in UAT

i am just using command like
"npx prisma migrate deploy" to deploy migration files...

i have 34 migration done....
but now what i have done is like take a copy of databse ...
and restored it locally....
now my UAT databse is in my local postgresDB...named as "UAT_DB_IN_LOCAL" (database having same data in ALL table as UAT)
-------
i have added in schema file
model stu {
id int?
name string?
}

now i am using command like ....

npx prisma migrate dev --create-only

its now coming to 28th migration correctly

and for 29th migration its saying like below

The migration 20241021113752_dcs_mangement was modified after it was applied.
? We need to reset the "public" schema at "localhost:5432"
Do you want to continue? All data will be lost. » (y/N)


i know that i have added all migration in UAT database sucessfully......

also there are 34 files presenr and 34 rows in prisma_migration table .....

then why i am getting error.....

if i make different db name as "UAT_LOCAL_DB_TEST" (no data is restored empty db) and apply there its making migration.sql file correctly....

and if i use on "UAT_DB_IN_LOCAL"

"npx prisma migrate deploy"

then tables are created goodly......
--------------------------------------------------------------------------------
why i cant "npx prisma migrate dev --create-only" use it "UAT_DB_IN_LOCAL" ...........and create migration file?????
Was this page helpful?