question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`[2] InterpretationError("Error for binding \'4\': DomainError(ConversionFailure(\"record identifier\", \"assimilated record identifier\"))")` (after upgrade to beta)

See original GitHub issue

I recently upgraded from the alpha to beta and followed the migration guides. When I start my app however I get the following error:

[2] Invalid `prisma.log.upsert()` invocation in
[2] /Users/cwd/src/calm/server/src/schema/Log.ts:34:29
[2] 
[2] Error occurred during query execution:
[2] InterpretationError("Error for binding \'4\': DomainError(ConversionFailure(\"record identifier\", \"assimilated record identifier\"))")
[2]     at PrismaClientFetcher.request (/Users/cwd/src/calm/node_modules/@prisma/client/runtime/index.js:1:51485)
[2]     at processTicksAndRejections (internal/process/task_queues.js:93:5)

I’m guessing I’ve missed something in my schema, but if I run an introspection it looks the same to me. More than anything I feel like the above error could possibly be more helpful 😄

anyways, here is my current schema:

datasource postgresql {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

generator client {
  provider = "prisma-client-js"
  output   = "../node_modules/@prisma/client"
}

model User {
  id           String    @default(cuid()) @id
  createdAt    DateTime  @default(now())
  updatedAt    DateTime  @updatedAt

  fireIdDev    String?   @unique
  fireIdStage  String?   @unique
  fireIdProd   String?   @unique

  name         String?
  email        String    @unique

  logs         Log[]     @relation("UserLogs")
  projects     Project[] @relation("CreatedProjects")

  items        Item[]    @relation("OwnedItems")
  itemsCreated Item[]    @relation("CreatedItems")
}

model Item {
  id             String    @default(cuid()) @id
  createdAt      DateTime  @default(now())
  updatedAt      DateTime  @updatedAt
  isDeleted      Boolean   @default(false)
  deletedAt      DateTime?

  // User relationships
  creator        User      @relation("CreatedItems", fields: [creatorId], references: [id])
  creatorId      String

  owner          User      @relation("OwnedItems", fields: [ownerId], references: [id])
  ownerId        String

  // Item info
  title          String?
  type           ItemType

  // Meta info
  checkIn        CheckIn?  @relation("ItemCheckin", fields: [checkInId], references: [id])
  checkInId      String?   @unique

  // Where does this item live
  log            Log?      @relation("ItemLog", fields: [logId], references: [id])
  logId          String?

  project        Project?  @relation("ItemProject", fields: [projectId], references: [id])
  projectId      String?

  // Timeline
  previousItem   Item?     @relation("PreviousNext", fields: [previousItemId], references: [id])
  nextItem       Item?     @relation("PreviousNext")
  previousItemId String?   @unique

  lastItem       Item?     @relation("ItemHistory", fields: [lastItemId], references: [id])
  history        Item[]    @relation("ItemHistory")
  lastItemId     String?

  // Task Fields
  isComplete     Boolean   @default(false)
  completedAt    DateTime?
}

model Log {
  id        String   @id
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt

  owner     User     @relation("UserLogs", fields: [ownerId], references: [id])
  ownerId   String

  type      LogType
  date      String

  items     Item[]   @relation("ItemLog")
}

model Project {
  id        String    @default(cuid()) @id
  createdAt DateTime  @default(now())
  updatedAt DateTime  @updatedAt
  isDeleted Boolean   @default(false)
  deletedAt DateTime?

  title     String

  creator   User      @relation("CreatedProjects", fields: [creatorId], references: [id])
  creatorId String

  items     Item[]    @relation("ItemProject")
}

model CheckIn {
  id        String   @default(cuid()) @id
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt

  item      Item?    @relation("ItemCheckin")

  latitude  Float
  longitude Float

  location  String?
  weather   String?
}

enum ItemType {
  A
  B
  C
  D
}

enum LogType {
  A
  B
  C
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
jkottapacommented, Apr 2, 2020

I was able to resolve my issues by following @janpio suggestion on a different issue.

Modify your schema.prisma model relations to the ones described here: https://github.com/prisma/prisma/releases/tag/2.0.0-beta.1

Edit: in particular this section => “New syntax for defining relations”

2reactions
arvindellcommented, Apr 2, 2020

@jayanth1991 Thank you, I read it and it seems to be fixed for now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

prisma - `[2] InterpretationError ( "\ '4 \'바인딩 오류 : DomainError ...
... [2] [2] Error occurred during query execution: [2] InterpretationError("Error for binding \'4\': DomainError(ConversionFailure(\"record identifier\", ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found