Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prisma studio not showing the data from the db #681

Closed
shubhsk88 opened this issue May 12, 2021 · 2 comments
Closed

Prisma studio not showing the data from the db #681

shubhsk88 opened this issue May 12, 2021 · 2 comments
Assignees
Labels
bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. kind/bug A reported bug.
Milestone

Comments

@shubhsk88
Copy link

Bug description

I was having the problem where my data from database in prisma studio isn’t showing and when I am making the query that data in prisma client it is showing without any problem

How to reproduce

  1. Go to 'prisma' root repository

  2. Run 'npx prisma studio'

  3. The tables are empty instead of filled with data

Expected behavior

No response

Prisma information

  provider = "prisma-client-js"
}

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

model User {
  id          String    @id @default(cuid())
  fullName    String?
  username    String    @unique
  email       String?   @unique
  password    String?
  bio         String?
  gender      String?
  avatar      String?
  createdAt   DateTime? @default(now())
  updatedAt   DateTime? @updatedAt
  token       String?   @unique
  website     String?
  profile     Profile?
  phoneNumber String?

  comments  Comment[]
  likes     Like[]
  messages  Message[]
  photos    Photo[]
  chatrooms ChatRoom[]
  followers User[]     @relation("UserFollows")
  following User[]     @relation("UserFollows")
}

model Profile {
  id       Int       @id @default(autoincrement())
  socialId String?
  authType AuthType?
  userId   String    @unique
  User     User      @relation(fields: [userId], references: [id])
}

model Photo {
  id        Int       @id @default(autoincrement())
  caption   String?
  file      String
  createdAt DateTime  @default(now())
  updatedAt DateTime  @updatedAt
  userId    String
  user      User      @relation(fields: [userId], references: [id])
  comments  Comment[]
  likes     Like[]
  hashtags  HashTag[]
}

model HashTag {
  id        Int      @id @default(autoincrement())
  hashtag   String   @unique
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt
  photos    Photo[]
}

model Like {
  id        Int      @id @default(autoincrement())
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt
  userId    String
  photoId   Int
  photo     Photo    @relation(fields: [photoId], references: [id])
  user      User     @relation(fields: [userId], references: [id])

  @@unique([photoId, userId], name: "uniquelike")
}

model Comment {
  id        Int      @id @default(autoincrement())
  userId    String
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt
  text      String
  photoId   Int
  photo     Photo    @relation(fields: [photoId], references: [id])
  user      User     @relation(fields: [userId], references: [id])
}

model ChatRoom {
  id        Int       @id @default(autoincrement())
  createdAt DateTime  @default(now())
  updatedAt DateTime  @updatedAt
  messages  Message[]
  users     User[]
}

model Message {
  id         Int      @id @default(autoincrement())
  text       String
  chatRoomId Int
  read       Boolean  @default(false)
  createdAt  DateTime @default(now())
  updatedAt  DateTime @updatedAt
  userId     String
  chatRoom   ChatRoom @relation(fields: [chatRoomId], references: [id])
  user       User     @relation(fields: [userId], references: [id])
}

enum AuthType {
  google
  email
  facebook
}

Environment & setup

  • OS: MacOS
  • Database: PostgreSQL
  • Node.js version:14.15.4
  • Prisma version:2.20.1
  • Nexus Prisma
@pantharshit00 pantharshit00 transferred this issue from prisma/prisma May 14, 2021
@sdnts
Copy link
Contributor

sdnts commented May 14, 2021

Hey @shubhsk88, thanks for reporting this!
I recently fixed a similar issue, so could you try out npm install prisma@dev and see if this is still happening?

If not, then my fix likely solved your issue. It will land on stable on Tuesday, at which point, I'd recommend switching from the dev version to the stable version, since dev versions are likely to contain breaking / unannounced changes.

If it still is, let me know!

@sdnts sdnts added bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. kind/bug A reported bug. labels May 14, 2021
@sdnts
Copy link
Contributor

sdnts commented May 17, 2021

Hey, going to close this in favour of #649, but please reopen if you think this is still happening!

@sdnts sdnts closed this as completed May 17, 2021
@sdnts sdnts self-assigned this May 17, 2021
@sdnts sdnts added this to the 2.23.0 milestone May 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. kind/bug A reported bug.
Projects
None yet
Development

No branches or pull requests

2 participants