https://www.prisma.io/ logo
Join Slack
Powered by
# orm-help
  • j

    James Pickard

    09/20/2022, 9:51 AM
    I am continuing to have a pretty bad time with migrations. I basically never want prisma to delete all my data, even in dev.
    ✅ 1
    r
    • 2
    • 8
  • j

    James Pickard

    09/20/2022, 9:55 AM
    What is the correct way to do migrations? Modify schema.prisma then run something, or modify the database then running something?
    r
    • 2
    • 1
  • j

    James Pickard

    09/20/2022, 9:55 AM
    Also, how do I start again - like, just give me a schema from whatever is in the database. Then I would expect no migrations to be necessary.
    ✅ 1
    r
    • 2
    • 17
  • n

    Nurul

    09/20/2022, 12:30 PM
    Responded here: https://prisma.slack.com/archives/CA491RJH0/p1663675189328399?thread_ts=1663602606.227959&cid=CA491RJH0
    👍 1
  • r

    Rob

    09/20/2022, 5:13 PM
    Hi all, im using docker and have successfully set up a connection to a dockerized postgresql within my dockerized prisma node app. However, I'm getting error " The table
    public.users
    does not exist in the current database". I have the prisma schema files that are ready to update, but what command do I actually use to update the db schema? I know I need to use prisma CLI I think
    ✅ 1
    m
    n
    • 3
    • 2
  • l

    Lauany Reis da Silva

    09/20/2022, 6:18 PM
    Hi everyone. I have problem in my Application dockerized prisma with mysql and node 16, about this I'm use the command docker-compose to set up my API. However, I'm getting error "Error: Command failed: /usr/src/app/node_modules/.bin/mmdc -i /tmp/prisma-erd-MvByKD/prisma.mmd -o /usr/src/app/prisma/ERD.svg -t forest -c /tmp/prisma-erd-MvByKD/config.json" in the last step. Even after updating my prisma.schema file the problem remains, but I don't know solve this issue. Can someone help me please? Thanks in advance.
    r
    v
    • 3
    • 9
  • m

    Muhannad

    09/20/2022, 6:35 PM
    Hi everyone 👋 I am trying to use Prisma with single store (cloud-native database singlestore), Have anyone used Prisma with SingleStore before? it seems there is an open issue related to SingleStore: https://github.com/prisma/prisma/issues/2935 i am experiencing a weird issues while i am pushing the db changes one of the issues : i have to do this for each model @@id
    Copy code
    @@index([id], map: "__SHARDKEY")
    second issue: incorrect
    dateTime           _DateTime_       @db.DateTime()
    correct
    dateTime           _DateTime_       @db.DateTime(0)
    Thanks in advance 🙏
    ✅ 1
    n
    • 2
    • 1
  • j

    Jonathan Marbutt

    09/20/2022, 7:32 PM
    This is more of a random theory question about prisma and where you have some logic live. I have a table
    contacts
    and a table
    addresses
    . Table
    addresses
    has a
    contactId
    and
    isPrimary
    . And
    contacts
    has a
    primaryAddressId
    in the table. If someone updates or adds an Address that
    isPrimary = true
    then it should set the contact’s
    primaryAddressId
    . So where would you as a prisma dev have this live? • Database Trigger • Middleware • Just my api code? • Somewhere else? This is actually a part of a bigger internal discuss I have been having and was curious this community’s thoughts
    ✅ 1
    m
    j
    n
    • 4
    • 19
  • v

    Varshith Kumar

    09/20/2022, 8:12 PM
    How can I stop data loss here?
    ✅ 1
    m
    j
    n
    • 4
    • 7
  • t

    Taylor Lindores-Reeves

    09/20/2022, 9:16 PM
    Hey guys, anyone had much luck with tracing?
    ✅ 1
    n
    • 2
    • 1
  • t

    Taylor Lindores-Reeves

    09/20/2022, 9:17 PM
    And yet, as you can see from the Jaeger UI, we are only seeing Prisma traces. Does anyone know how we can make these more comprehensive by including the entire request trace?
    ✅ 1
    n
    • 2
    • 1
  • t

    Tri Nguyen

    09/21/2022, 12:38 AM
    hi everyone, I have a question regarding migration. All of the scenario is against my local db. • Let’s say I have a main branch where migration 1 is the latest. • I then create feature 2 branch and make a new migration 2. • When I finish with feature 2, I then go back to main branch and create new branch for feature 3. At this point, my db is having the changes done by migration 2. How can I correctly create a migration 3 for this branch? Currently, whenever I do it, it will ask me to reset db since the number of migration is not similar (migration 2 doesn’t exist on this branch). So a couple of Qs beside that too: • how should I deal with that when this get merged and deploy? Will Prisma asks my prod db to reset too? • Will it be any different if I choose to merge feature 2 before or after feature 3? Remember that feature 2 is done before feature 3, so technically speaking, when both are merged, migration 2 will be before migration 3 • Am I doing this one wrong? I keep having the feeling that I should make a separate branch to update the db and merge it to the main branch asap to allow other branches to have access to the migration, but it doesn’t always feel right to do it.
    j
    • 2
    • 14
  • k

    Kevin Reed

    09/21/2022, 1:03 AM
    Does anyone have any experience with setting up Prisma/ PostgreSQL on a local machine and then connecting to it through your external IPv4? I can connect to it through my LAN no problem (using internal IPv4), but when I try and use my external IPv4 (after port forwarding and allowing inbound & outbound traffic on the machine through ufw) it just won't connect.
    Copy code
    Message: Error in Prisma Client request: 
    
    
    Invalid `prisma.entry.findMany()` invocation:
    
    
    Can't reach database server at `external_ipv4_redacted`:`5000`
    
    Please make sure your database server is running at `external_ipv4_redacted`:`5000`.
      
    Query:
    {
      "modelName": "Entry",
      "operation": "findMany",
      "args": {
        "take": 100,
        "skip": 0,
        "select": {
          "id": true
        }
      }
    }
    ✅ 1
    t
    n
    • 3
    • 4
  • n

    Nurul

    09/21/2022, 6:38 AM
    Hi Varshith 👋 Did you had a look at baselining docs? Baselining is usually used for data that must be maintained (like production), which means that the database cannot be reset
    v
    • 2
    • 1
  • h

    Hammedctgr

    09/21/2022, 8:27 AM
    Hello techies, im building a fullstack app with Nextjs, Prisma, and PostgreSql. I am trying to activate the next-auth with my github. Everything is configured fine, when I connected it with local host and configured the oauth app on github, i can use my github to login to the app, but when I try to connect the nextauth_url with the url of my prospective vercel app...its saying server error. Am i in the right place to get answers? this is the repo (https://github.com/muhammedctgr/p-hammed-blogr-nextjs-prisma) and this is where its hosted https://p-hammed-blogr-nextjs-prisma.vercel.app/ Thanks in advance.
    👀 1
    ✅ 1
    r
    • 2
    • 9
  • n

    Nurul

    09/21/2022, 9:49 AM
    Hey Taylor 👋 How exactly have you configured tracing? Is this happening on the latest Prisma version? Just to confirm, are you following this guide? https://www.prisma.io/docs/concepts/components/prisma-client/opentelemetry-tracing#visualize-traces-with-jaeger
    t
    • 2
    • 2
  • k

    Kenny Tran

    09/21/2022, 11:35 AM
    Hey, I have a question regarding the $transaction API. Let's presume there is two sequential queries wrapped like following
    const [queryOne, queryTwo] = await prisma.$transaction([])
    The transaction will fail if one of them fails but what happens if one of them succeed and the other fails? Will the query that succeeded actually run towards the DB even though the other query failed?
    ✅ 1
    j
    r
    • 3
    • 3
  • m

    Matt Langer

    09/21/2022, 12:18 PM
    Hey folks, just wanted to let you know the exported type
    PrismaAction
    referenced by
    MiddlewareParams
    is missing the new new
    findFirstOrThrow
    and
    findUniqueOrThrow
    actions from the 4.0 release. Easy enough for us to patch with TS unions but thought you'd want it on your radar 🙌
    ✅ 1
    n
    v
    • 3
    • 3
  • j

    J R

    09/21/2022, 12:51 PM
    Hello, is there a channel for questions around Prisma and implementation in projects?
    ✅ 1
    r
    v
    • 3
    • 2
  • d

    doddy nicolas

    09/21/2022, 1:29 PM
    i have this error even if credentials are correct
  • d

    doddy nicolas

    09/21/2022, 1:29 PM
    { "errors": [ { "message": "Unexpected error.", "locations": [ { "line": 2, "column": 3 } ], "path": [ "users" ], "extensions": { "originalError": { "message": "\nInvalid
    prisma.user.findMany()
    invocation:\n\n\nAuthentication failed against database server at
    localhost
    , the provided database credentials for
    root
    are not valid.\n\nPlease make sure to provide valid database credentials for the database server at
    localhost
    .", "stack": "Error: \nInvalid
    prisma.user.findMany()
    invocation:\n\n\nAuthentication failed against database server at
    localhost
    , the provided database credentials for
    root
    are not valid.\n\nPlease make sure to provide valid database credentials for the database server at
    localhost
    .\n at RequestHandler.handleRequestError (D:\\prisma\\es-app\\node_modules\\@prisma\\client\\runtime\\index.js2991513)\n at RequestHandler.request (D:\\prisma\\es-app\\node_modules\\@prisma\\client\\runtime\\index.js2989212)\n at async PrismaClient._request (D:\\prisma\\es-app\\node_modules\\@prisma\\client\\runtime\\index.js3086416)\n at async Object.users (webpack-internal:///(api)/./pages/api/graphql.ts7828)\n at async Promise.all (index 0)\n at async file///D/prisma/es-app/node_modules/@envelop/core/esm/orchestrator.js37727\n at async processRequest (file///D/prisma/es-app/node_modules/@graphql-yoga/common/esm/processRequest.js2320)\n at async YogaNodeServer.getResponse (file///D/prisma/es-app/node_modules/@graphql-yoga/common/esm/server.js31328)\n at async YogaNodeServer.YogaServer.handleRequest (file///D/prisma/es-app/node_modules/@graphql-yoga/common/esm/server.js6930)\n at async YogaNodeServer.handleIncomingMessage (file///D/prisma/es-app/node_modules/@graphql-yoga/node/esm/index.js5326)" } } } ], "data": null }
    r
    v
    • 3
    • 25
  • s

    Slackbot

    09/21/2022, 2:42 PM
    This message was deleted.
  • r

    Raif Harik

    09/21/2022, 3:07 PM
    Hi, starting new job today and having an issue with ubuntu 22.04 and prisma v2.27. I can't very well tell them they have to upgrade before I even get the code running on dayone. So I need to work this around. can some one give a hand?
    ✅ 1
    r
    • 2
    • 3
  • y

    Yusuf Musa

    09/21/2022, 3:36 PM
    Hey guys, sorry to be that guy that joins and asks a question immediately but I need some help with deploying Prisma on Firebase Functions but I believe I'm getting an error because
    PrismaClient
    is not being generated. I've tried searching online and added this
    postinstall
    script in my
    package.json
    that does a
    yarn prisma generate
    but I'm lost at how that all works. For context -- I'm using Firebase Functions to schedule regular updates to update the database (Planetscale) and add new rows/prune old ones. Not sure if the error message helps but here's what Firebase Functions returned.
    👀 1
    a
    v
    • 3
    • 4
  • v

    ven v

    09/21/2022, 3:49 PM
    Hi - I am trying to implement cursor based pagination. (docs here - https://www.prisma.io/docs/concepts/components/prisma-client/pagination) . how do I know I have reached the last batch available? my "isLoading" spinner just keeps spinning and no exception is being thrown.
    👀 1
    j
    a
    • 3
    • 3
  • r

    Ryan Roline

    09/21/2022, 5:36 PM
    Hello! Would someone be able to provide me an example of adding a second schema Prisma using prisma-util? For example, I would like access to this table public.table1 and access to schema2.table1 by adding the correct settings in prisma-util.config.json. Currently the connection I have setup only has access to the database's public schema and I need to access other schemas. Thanks!
    🆘 1
    👀 1
    v
    v
    d
    • 4
    • 13
  • k

    Kostas Karaolis

    09/21/2022, 6:12 PM
    I have a many-to-many relationship between jobs and locations. I first seed the locations and then when seeding the jobs I am trying to connect them with some locations like this
    locations: { connect: [{ id: 1 }, { id: 2 }] },
    but it is not connecting the jobs with locations. any ideas what I am doing wrong?
    ✅ 1
    a
    v
    • 3
    • 3
  • j

    Jake W

    09/21/2022, 9:14 PM
    do i ask my questions here? i asked mine in #mongodb but not sure if thats the right place
    ✅ 1
    v
    • 2
    • 1
  • n

    Nick Green

    09/21/2022, 9:15 PM
    Hi community, I’m trying to deploy an application with prisma and expressJs on a Freebsd server and its said that needs binaries when try to get them it’s said that binaries were not found… anyone knows?
    👀 1
    r
    v
    • 3
    • 2
  • f

    Fishie

    09/22/2022, 9:13 AM
    if i got a prisma field like this:
    roleIds: String[]
    How can I delete 1 value from many users?
    Copy code
    await prisma.serverMember.updateMany({where: {roleIds: {has: roleId}}, data: {
      roleIds: // what goes here?
    }});
    👀 1
    ✅ 1
    r
    • 2
    • 14
1...623624625...637Latest