Error while initating `pmt init`
See original GitHub issueHello , this my first time to use pmt and i cant initaite a pmt
i think there is a typo because the application trying to read from PMT_MANAGMENT_URL while the created one is MANAGMENT_URL
[](Users\donda\WebstormProjects\new-BackEnd-carRental>pmt init --verbose
Installing `@prisma-multi-tenant/client` as a dependency in your app...
$> npm install @prisma-multi-tenant/client@2.3.1
npm WARN @nexus/schema@0.15.0 requires a peer of graphql@^14.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN apollo-cache-control@0.1.1 requires a peer of graphql@0.10.x - 0.13.x but none is installed. You must install peer dependencies yourself.
npm WARN graphql-subscriptions@1.1.0 requires a peer of graphql@^0.10.5 || ^0.11.3 || ^0.12.0 || ^0.13.0 || ^14.0.0 but none is installed. You must install peer de
pendencies yourself.
npm WARN apollo-server-core@1.4.0 requires a peer of graphql@^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 but none is installed. You must install peer depend
encies yourself.
npm WARN apollo-tracing@0.1.4 requires a peer of graphql@0.10.x - 0.13.x but none is installed. You must install peer dependencies yourself.
npm WARN apollo-upload-server@7.1.0 requires a peer of graphql@0.13.1 - 14 but none is installed. You must install peer dependencies yourself.
npm WARN graphql-extensions@0.0.10 requires a peer of graphql@0.10.x - 0.13.x but none is installed. You must install peer dependencies yourself.
npm WARN graphql-import@0.7.1 requires a peer of graphql@^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 but none is installed. You must install peer dependencies yoursel
f.
npm WARN graphql-middleware@4.0.1 requires a peer of graphql@^0.12.0 || ^0.13.0 || ^14.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN graphql-playground-middleware-lambda@1.7.12 requires a peer of aws-lambda@^0.1.2 but none is installed. You must install peer dependencies yourself.
npm WARN graphql-subscriptions@0.5.8 requires a peer of graphql@^0.10.5 || ^0.11.3 || ^0.12.0 || ^0.13.0 but none is installed. You must install peer dependencies
yourself.
npm WARN graphql-upload@8.1.0 requires a peer of graphql@0.13.1 - 14 but none is installed. You must install peer dependencies yourself.
npm WARN nexus-prisma@0.13.0 requires a peer of @nexus/schema@^0.13.1 but none is installed. You must install peer dependencies yourself.
npm WARN nexus-prisma@0.13.0 requires a peer of @prisma/client@2.0.0-beta.4 but none is installed. You must install peer dependencies yourself.
npm WARN nexus-prisma@0.13.0 requires a peer of graphql@^14.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN graphql-auth@1.0.0 No description
npm WARN graphql-auth@1.0.0 No repository field.
npm WARN graphql-auth@1.0.0 No license field.
We will now configure the management database:
? Management database url: "postgresql://postgres:123456@localhost:5432/postgres?schema=public"
? Are you sure of your inputs? Yes
Updating .env and schema.prisma files...
Generating prisma clients for both management and tenants...
$> node "C:\Users\donda\WebstormProjects\new-BackEnd-carRental\node_modules\@prisma\cli\build\index.js" generate --schema prisma/schema.prisma
Environment variables loaded from provided --schema directory
$> node "C:\Users\donda\WebstormProjects\new-BackEnd-carRental\node_modules\@prisma\cli\build\index.js" generate
✔ Generated Prisma Client to .\..\..\..\.prisma-multi-tenant\management in 452ms
You can now start using Prisma Client in your code:
import { PrismaClient } from '@prisma/client'
// or const { PrismaClient } = require('@prisma/client')
const prisma = new PrismaClient()
Explore the full API: http://pris.ly/d/client
Setting up management database...
$> node "C:\Users\donda\WebstormProjects\new-BackEnd-carRental\node_modules\@prisma\cli\build\index.js" migrate up --create-db --experimental
Error: P1012
Get config
error: Error validating datasource `management`: The URL for datasource `management` must start with the protocol `file:`.
--> schema.prisma:3
|
2 | provider = ["sqlite","mysql","postgresql"]
3 | url = env("PMT_MANAGEMENT_URL")
|
Validation Error Count: 1
Unknown Error!
Error: Command failed: node "C:\Users\donda\WebstormProjects\new-BackEnd-carRental\node_modules\@prisma\cli\build\index.js" migrate up --create-db --experimental
Error: P1012
Get config
error: Error validating datasource `management`: The URL for datasource `management` must start with the protocol `file:`.
--> schema.prisma:3
|
2 | provider = ["sqlite","mysql","postgresql"]
3 | url = env("PMT_MANAGEMENT_URL")
|
Validation Error Count: 1
at ChildProcess.exithandler (child_process.js:303:12)
at ChildProcess.emit (events.js:315:20)
at maybeClose (internal/child_process.js:1051:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) {
killed: false,
code: 1,
signal: null,
cmd: 'node "C:\\Users\\donda\\WebstormProjects\\new-BackEnd-carRental\\node_modules\\@prisma\\cli\\build\\index.js" migrate up --create-db --experimental'
}
)
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Why PMT.sh (profile management GUI tool) failed to launch ...
Running pmt.sh (Profile management GUI tool) failed to launch with below error produced under User_Home/.ibm/WebSphere/configurations/WCT85/XXXXXXX.log file ...
Read more >Error Could not create the Java virtual machine while creating ...
Firstly, I try open the comand line as Adminstrator and run manageprofiles. Secondly, I downloaded certain tool named run_manageprofilesInteractive but I still ...
Read more >Crash of Leiden algorithm on 600 million vertices and 3.8 ...
It works until you construct a graph in this code and initialize ... An error occurs in the middle of executing the leiden...
Read more >subject:"Re\: \[Discuss\-gnuradio\] runtime error while running ...
My objective is to create a block which changes the frequency automatically in steps of 2e6, starting from 2.37e9. My block has a...
Read more >'Forbidden' from using the Permissions management tool
Since reinstalling the PMT, I now get something like the error below when I try to list the existing groups or do any...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes this clarify it
Thank you so much this issue can be closed now
Alright, so here is how Prisma-multi-tenant works:
You have a management database (here the “management” postgresql schema). This management db is solely handled by Prisma-multi-tenant. It will only contain the references (name + url) to all of your tenants.
You will also have other databases (=postgresql schema): one for each of your tenant.
To create a new tenant, you simple have to call the
pmt new
command, which will then ask you the desired name + url of the tenant. After that, prisma-multi-tenant will create the database (=postgresql schema) itself, and add the name+url of the tenant in the management database.So: 1 db for management + X databases for your tenants.
When you want to migrate all of your tenant’s databases at the same time, you can call
pmt migrate up
which will actually callprisma migrate
on each of the tenant’s databases, one by one.I hope I was able to answer your questions 🙂