IssueRaiser

Run migrations by code

I have a project with a main database, called general and inside it a table of companies, each company has a different database. My problem is the following, in this project I use the typeorm, but I am considering migrating to the prisma, the problem is that in the typeorm I can run the migrations inside the connection. ```typescript await connection.runMigrations({ transaction: 'all', }); ``` Is there any way to get it to run in the same way as typeorm here in prisma?? I can connect to another db with a custom url: ```ts import { PrismaClient } from '@prisma/client' const client1 = new PrismaClient({ datasources: { db: { url: 'postgres://localhost/db1' }} }) ``` https://github.com/prisma/prisma/issues/2443#issuecomment-630679118

Posted by andreghisleni on May 29, 2022, 4:21 AM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.2,500 issues0 comments

github (Software)

Run migrations by code

andreghisleniMay 29, 2022, 4:21 AM

I have a project with a main database, called general and inside it a table of companies, each company has a different database. My problem is the following, in this project I use the typeorm, but I am considering migrating to the prisma, the problem is that in the typeorm I can run the migrations inside the connection. ```typescript await connection.runMigrations({ transaction: 'all', }); ``` Is there any way to get it to run in the same way as typeorm here in prisma?? I can connect to another db with a custom url: ```ts import { PrismaClient } from '@prisma/client' const client1 = new PrismaClient({ datasources: { db: { url: 'postgres://localhost/db1' }} }) ``` https://github.com/prisma/prisma/issues/2443#issuecomment-630679118

Comments (0)

No comments yet. Start the discussion.

Comment on this issue