Pedro Bonamin
07/13/2022, 1:29 PMFiqri Syah Redha
07/13/2022, 1:30 PMspohl
07/13/2022, 3:06 PMTam Carre
07/13/2022, 3:30 PMRaw query failed. Code: `1064`. Message: `You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 1` Error: Raw query failed. Code: `1064`. Message: `You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 1`Gezim
07/13/2022, 5:21 PMIt should be understood as the set of changes to get from the expected schema to the actual schema.
[+] Added tables
  - _RecipeToFilterOption
[-] Removed tables
  - recipes_filters_join
[*] Changed the `_RecipeToFilterOption` table
  [+] Added unique index on columns (A, B)
  [+] Added index on columns (B)
  [+] Added foreign key on columns (A)
  [+] Added foreign key on columns (B)
[*] Changed the `recipes_filters_join` table
  [-] Removed foreign key on columns (recipeFilterOptionId)
  [-] Removed foreign key on columns (recipeId)karolis
07/13/2022, 6:43 PMamenity from particular chalet
Is this is how I do it?
await prisma.chalet.update({ where: { id }, data:{ amenities: { disconnect:{ id }}}});
Can/should I do it other way around? (disconnecting chalet from amenity)? I'm confused
What my rest api route should look like? do I target chalet or amenity?
My sample schema:
model Chalet {
  id           String    @id @unique @default(cuid())
  bookings     Booking[]
  reviews      Review[]
  amenities    Amenity[]
}Vanessa Kroeker
07/13/2022, 6:50 PMnpx prisma migrate resolve --rolled-back 20220713234002_some_migration step. When I try to use this to record that the migration has been rolled back, I get  the error
Error: P3012
Migration `20220713234002_some_migration` cannot be rolled back because it is not in a failed state.
Currently running Prisma v3.15.2.Halvor
07/13/2022, 7:17 PMSchalk Neethling
07/13/2022, 9:07 PMmodel Difficulty or, model Difficulties. I kinda think the singular is stuck in my head because of the Django ORM, but I am not sure 🙂Rene Melo
07/13/2022, 9:08 PMJannik Köster
07/14/2022, 9:04 AMType error: Property 'subscription' does not exist on 
type 'PrismaClient<PrismaClientOptions, never, RejectOnNotFound | RejectPerOperation | undefined>'.
As soon as i try to deploy to vercel, i get an error that subscription does not exist. but everything works fine in development, im using the same db for development and production(for now). Can someone help me here why this is happening. If i build locally for production this is working aswell.Jannik Köster
07/14/2022, 9:04 AMdatasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
shadowDatabaseUrl = env("SHADOW_DATABASE_URL")
}
generator client {
  provider        = "prisma-client-js"
}
model Account {
  id                 String  @id @default(cuid())
  userId             String
  type               String
  provider           String
  providerAccountId  String
  refresh_token      String?  @db.Text
  access_token       String?  @db.Text
  expires_at         Int?
  token_type         String?
  scope              String?
  id_token           String?  @db.Text
  session_state      String?
  user User @relation(fields: [userId], references: [id], onDelete: Cascade)
  @@unique([provider, providerAccountId])
}
model Session {
  id           String   @id @default(cuid())
  sessionToken String   @unique
  userId       String
  expires      DateTime
  user         User     @relation(fields: [userId], references: [id], onDelete: Cascade)
}
model User {
  id            String    @id @default(cuid())
  name          String?
  email         String?   @unique
  password String?
  emailVerified DateTime?
  image         String?
  accounts      Account[]
  sessions      Session[]
  role  Role    @default(USER)
  payments    Payment[] 
}
enum Role {
  USER
  PREMIUM
  ADMIN
}
model VerificationToken {
  identifier String
  token      String   @unique
  expires    DateTime
  @@unique([identifier, token])
}
model Payment {
        id           String   @id @default(cuid())
        orderID String
        status  String
        price String
        user User @relation(fields: [userId], references: [id], onDelete: Cascade)
        userId String       
}
model Subscription {
  id           String   @id @default(cuid())
  price       String 
  text       String
  description String
}
This is my schemashahrukh ahmed
07/14/2022, 9:58 AMNEERAJ SAMEER ALLU
07/14/2022, 10:54 AMSlackbot
07/14/2022, 3:38 PMTimothy Choi
07/14/2022, 10:21 PMRichard Ku
07/15/2022, 1:37 AMerror: No such argument.
  -->  schema.prisma:326
   | 
325 | 
326 |   @@index([eway_txn_id], Map: "consolidated_eway_txn_id_idx")
it looks like it doesn't understand Map: "consolidated_eway_txn_id_idx" but it was generated by the prisma db pull. I tried to check the doc about @@index, but I cannot find info about the Map parameter. But I assume if it is created by the db pull, it should be valid? Please advise. Thanks.Tri Nguyen
07/15/2022, 2:42 AMUser <-> UserPost <-> Post
So user and post are many-to-many and I explicit state a table called userpost in between. How can I select user that is linked with post?
My initial try is
prisma.post.user.findMany({
    where: {
         links: {// I called the middle table link in schema
              every: {
                   post: myPost,
              }
         }
    }
})
but I don’t think that’s what I should do since it’s filtering. Can someone help me outVignesh T.V.
07/15/2022, 5:32 AMOscar Stahlberg
07/15/2022, 9:59 AMnpx prisma db pull for example needs to connect to the database which is running inside of our Kubernetes cluster. As we are using TLS certificates to authenticate the client (node app in this example) with the database, we don’t have access to those certificates in our build process.
Where should I run those commands? Am I missing something here? Similar question about npx prisma migrate deploy . Thank you for your help!Arthur Roberto Fronza
07/15/2022, 12:42 PMBrothak
07/15/2022, 2:15 PMMaciej Błędkowski
07/15/2022, 7:29 PM[key: String]: String , but in Prisma? I use mongoDB as a databaseMaciej Błędkowski
07/15/2022, 7:30 PMDanily
07/15/2022, 8:23 PMAaron Dye JR
07/16/2022, 9:16 AM@prisma/client . Here are the current errors relating to the index.d.ts https://www.toptal.com/developers/hastebin/ojenalanoh.md. I am wondering if I should downgrade or if I am missing somethingRainer Lang
07/16/2022, 5:08 PMMax Blancarte
07/17/2022, 9:55 PMconst persons = [
	{
		id: 'cblablabla',
		name: 'John',
		relatives: [
			{ id: '1', name: 'Sara' },
			{ id: '2', name: 'Bob' },
		],
	},
	{
		id: 'cblebleble',
		name: 'Sara',
		relatives: [
			{ id: '1', name: 'John' },
			{ id: '3', name: 'Bob' },
		],
	},
];
model People {
  id        String   @id @default(cuid())
  name      String
  relatives String[] or JSON ?
}Logic
07/18/2022, 2:18 AMtype keyword can only be used for mongo db. The only other way I can find to doing it is by creating another model and just linking it to the same id of the main model, but that just plunders when you have many other objects in the schema. nvm ill ask a question on the githubSzabi Hetei-Bako
07/18/2022, 4:36 AM