#Error when importing Prisma Schema

1 messages · Page 1 of 1 (latest)

ivory dune
#

When I import the prisma schema files which already has the users model then it gives this error.

This is my prisma schema.

// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

generator client {
provider = "prisma-client-js"
}

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

model Users {
id Int @id @default(autoincrement())
email String @unique
name String
profilePicture String @default("")
about String @default("")
sentMessages Messages[] @relation("sentMessages")
recievedMessages Messages[] @relation("recievedMessages")
}

model Messages {
id Int @id @default(autoincrement())
sender Users @relation("sentMessages",fields:[senderId],references: [id])
senderId Int
reciever Users @relation("recievedMessages", fields: [recieverId],references: [id])
recieverId Int
type String @default("text")
message String
messageStatus String @default("sent")
createdAt DateTime @default(now())
}

Prisma

The Prisma schema is the main configuration file when using Prisma. It is typically called schema.prisma and contains your database connection and data model.

verbal pendant
#

someone from team will reply to you very soon @ivory dune

inner pine
#

This is a part of the behavior of this feature.
We rename model names to singular and PascalCase
AND if in the imported schema we rename a model and the result is an entity that already exists, we add the Model suffix.