Errorname / prisma-multi-tenant

🧭 Use Prisma as a multi-tenant provider for your application
MIT License
396 stars 45 forks source link

initaite a pmt #53

Closed Mohammad-Alismael closed 4 years ago

Mohammad-Alismael commented 4 years ago

i think there is a typo because the application trying to read from PMT_MANAGMENT_URL while the created one is MANAGMENT_URL im on a mac

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 "/Users/apple/WebstormProjects/new-BackEnd-carRental/node_modules/@prisma/cli/build/index.js" generate --schema prisma/schema.prisma Environment variables loaded from provided --schema directory

$> node "/Users/apple/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 "/Users/apple/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 "/Users/apple/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 "/Users/apple/WebstormProjects/new-BackEnd-carRental//node_modules//@prisma//cli//build//index.js" migrate up --create-db --experimental' }

)

Errorname commented 4 years ago

Hi 👋 Thank you for reporting this issue and sorry for taking this long to answer 🙏

It looks like you used quotes (") when providing the management url, can you retry without them?

Errorname commented 4 years ago

This issue looks to be a duplicate of #52 . Don't hesitate to reopen if it doesn't work for you