hari_narayan
PPrisma
•Created by hari_narayan on 2/21/2025 in #help-and-questions
Migration issue in UAT
also i want to know about what is encoding of prisma migration.sql??
19 replies
PPrisma
•Created by hari_narayan on 2/21/2025 in #help-and-questions
Migration issue in UAT
what i have lern about checksum
------
git config --global core.autocrlf
it should be true.....
for that worspce of git......
while cloning repo
aslo never chage encoding of migration/XXXX/migration.sql files
-----
so that checksum created consistence......................
19 replies
PPrisma
•Created by Jpo on 2/11/2025 in #help-and-questions
Multiple DBs in a project
migrate:'-- npx prisma migrate deploy --schema prisma/schema.prisma'
in packge.json add
npm run migrate
like this
7 replies
PPrisma
•Created by Jpo on 2/11/2025 in #help-and-questions
Multiple DBs in a project
dotenv -e .env.supabasedev -- npx prisma migrate dev --schema prisma/db1-schema/db1-schema.prisma --create-only
add in packge.json script and then only it will run perfectly.......
7 replies
PPrisma
•Created by hari_narayan on 2/21/2025 in #help-and-questions
Migration issue in UAT
so i think in prisma cli there may be something which will ignore the migration while "npx prisma migrate dev --create-only"
so that if neare about shA checksum found ignore it and move forwrd there may i think possibility
of
squensing of migration depends in checksome....
dont know.....
can anyone know it in depth
19 replies
PPrisma
•Created by hari_narayan on 2/21/2025 in #help-and-questions
Migration issue in UAT
i am also getting different checksum which are not maching to my db but still everything is working??
19 replies
PPrisma
•Created by hari_narayan on 2/21/2025 in #help-and-questions
Migration issue in UAT
yes i know that its due to checksum
my file content and checkSum has relation..........
......
but then i have just removed one line and again added there.....
chnges to file will chang checkSum.....
but my production checksum should work in my UAT.....
but its now taking on next migration file......
19 replies
PPrisma
•Created by hari_narayan on 2/21/2025 in #help-and-questions
Migration issue in UAT
https://echobind.com/post/make-prisma-ignore-a-migration-change
this is possible solution i have got i have used it in windows with
Get-FileHash -Algorithm SHA256 prisma/migrations/20241021113752_dcs_mangement/migration.sql
and then i have updated checkSUm in db
but i dont know why it worked.....
and now due to this my
my migration goes down in _prisma_migration table........
i think upper is temporary thing......
i want some concreate solution please....
so that my migration sequence would not disturb and ...alll
19 replies
PPrisma
•Created by hari_narayan on 2/21/2025 in #help-and-questions
Migration issue in UAT
or git...
19 replies
PPrisma
•Created by hari_narayan on 2/21/2025 in #help-and-questions
Migration issue in UAT
i think prisma cli got some issues.....
19 replies
PPrisma
•Created by hari_narayan on 2/21/2025 in #help-and-questions
Migration issue in UAT
but then also problem persisted.......
i m getting same error
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)
see i dont wnat to loose data19 replies
PPrisma
•Created by hari_narayan on 2/21/2025 in #help-and-questions
Migration issue in UAT
npx prisma migrate resolve --applied 20241021113752_client_onbording_and_docs_mangementError: P3008
The migration
20241021113752_dcs_mangement
is already recorded as applied in the database.19 replies
PPrisma
•Created by hari_narayan on 2/21/2025 in #help-and-questions
Migration issue in UAT
{
"finished_at" : "2024-09-25T06:28:05.872Z",
"migration_name" : "20241021113752_dcs_mangement",
"started_at" : "2024-10-24T06:28:05.172Z",
"applied_steps_count" : 1
},
upper causing issue
19 replies
PPrisma
•Created by hari_narayan on 2/21/2025 in #help-and-questions
Migration issue in UAT
{
"_prisma_migrations": [
{
"finished_at" : "2024-09-25T06:28:05.872Z",
"migration_name" : "20240925062535_email",
"started_at" : "2024-09-25T06:28:05.172Z",
"applied_steps_count" : 1
},
{
"finished_at" : "2024-09-25T06:28:05.872Z",
"migration_name" : "20241021113752_dcs_mangement",
"started_at" : "2024-10-24T06:28:05.172Z",
"applied_steps_count" : 1
},
{
"finished_at" : "2024-10-24T13:08:21.393Z",
"migration_name" : "20241024130448_extra_column_removed",
"started_at" : "2024-10-24T13:08:20.747Z",
"applied_steps_count" : 1
}
]}
19 replies
PPrisma
•Created by Jpo on 2/11/2025 in #help-and-questions
Multiple DBs in a project
Yes
For that
|Prisma
|-schema1
|----------shema1.shema
|-shema2
|----------shema2.shema
|----------Migration
|-------------------initialMig
|---------------------mig.sql
Like that above
7 replies
PPrisma
•Created by hari_narayan on 1/23/2025 in #help-and-questions
Gi,Migration 2 shemafiles...schma1.prisma
Command like below
--Npx prisma migrate deploy --shema ./path/to/shema2.prisma
.....
But in documentation its not there......
15 replies
PPrisma
•Created by hari_narayan on 1/23/2025 in #help-and-questions
Gi,Migration 2 shemafiles...schma1.prisma
Yes its happening correctly......
Thanks.....
15 replies
PPrisma
•Created by hari_narayan on 1/29/2025 in #help-and-questions
Schema migration automation
Thanks for asking sir ....
On api call db url pass to prisma ---run command npx prisma migrate deploy script.....on cli......
8 replies
PPrisma
•Created by hari_narayan on 1/23/2025 in #help-and-questions
Gi,Migration 2 shemafiles...schma1.prisma
Yes but prisma migrate deploy is not happening.....
Generated migration files but
15 replies
PPrisma
•Created by hari_narayan on 1/25/2025 in #help-and-questions
Initialisation of prisma req based nestjs
return prismaService.$transaction(async (tx) => {
// Wrap the transaction function to provide company-specific transaction context
return fn(tx);
});
};
}
// Original method handling
if (prop in target && typeof target[prop] === 'function') {
return target[prop].bind(target);
}
return new Proxy(
{},
{
get: (_, methodProp) => {
return async (...args: any[]) => {
const prismaService = await this.moduleRef.resolve(
PrismaReqService,
originalContextId,
);
return prismaService[prop]methodProp;
};
},
},
);
},
});
}
// Optional: Add utility method for complex transactions
async runInTransaction<T>(fn: (tx: any) => Promise<T>): Promise<T> {
const prismaService = await this.moduleRef.resolve(
PrismaReqService,
ContextIdFactory.getByRequest(this.request),
);
return prismaService.$transaction(fn);
}
}
upper helped me do anyoneKnow why and how to make it more resilient
12 replies