Ali
08/31/2022, 8:56 AMAlef Solution2020
08/31/2022, 9:09 AMprisma
graphcool
dbs to the new db
What could be the issue?Fishie
08/31/2022, 9:16 AMmodel User {
id Int @id
name String
roles Role[]
}
model Role {
id Int @id
name String
users User[]
}
How can i return something like this?
[
{
id: 1,
name: "John",
roleIds: [1,2,3]
}
]
Dazzpowder
08/31/2022, 10:33 AMEmanuele Ricci
08/31/2022, 10:39 AMConnectorError(ConnectorError { user_facing_error: None, kind: ConnectionError(Timed out during query execution.) })
so I'm afraid that maybe I'm not using it in the correct way?
note: I'm using it locally with sqlite for testing purposesZahra Mumtaz
08/31/2022, 10:59 AM<tel:+15952999918|+1(595)299-9918>
using contains query but it’s not giving any result on special characters.
Any help?Jonathan
08/31/2022, 11:17 AMTaylor Lindores-Reeves
08/31/2022, 11:54 AMTaylor Lindores-Reeves
08/31/2022, 11:54 AMTaylor Lindores-Reeves
08/31/2022, 11:54 AMJason Marmon
08/31/2022, 10:16 PMpg_tgrm
- i added a migration with --create-only
, added this to the `migration.sql`:
CREATE EXTENSION IF NOT EXISTS pg_trgm;
CREATE INDEX IF NOT EXISTS "my_trgm_idx" ON "Stuff" USING gin ("title" gin_trgm_ops)
and then when I run yarn prisma migrate dev
prisma creates a new migration dropping the index. this is on prisma 4.2.1
. any ideas what I can do to prevent this?Alex Vilchis
08/31/2022, 11:43 PMprisma generate
without throwing an error if the variable DATABASE_URL
is not present? I need to just build my app. Any issue where I could track this?Ben Broich
09/01/2022, 6:01 AMKrunal modi
09/01/2022, 9:03 AMArpan Bagui
09/01/2022, 11:20 AMmodified_at
which is defined like DateTime @updatedAt
now I want to check if modified_at is more than 4 hrs using prisma query. Is it possible? Can anyone help me on that. Thank youMohit Gangrade
09/01/2022, 11:35 AM{
"compilerOptions": {
"sourceMap": true,
"outDir": "dist",
"strict": true,
"lib": [
"ESNext"
],
"esModuleInterop": true
}
}
Mohit Gangrade
09/01/2022, 11:35 AMnpx ts-node
Mohit Gangrade
09/01/2022, 11:39 AMnpm install @prisma/client
It worked after I ran this command.Mohit Gangrade
09/01/2022, 11:40 AMBaalamurgan K A
09/01/2022, 12:03 PMprisma.user.create()
invocation:\n\n\nPrisma needs to perform transactions, which requires your MongoDB server to be run as a replica setBaalamurgan K A
09/01/2022, 12:03 PMBaalamurgan K A
09/01/2022, 12:04 PMJason
09/01/2022, 1:07 PMmigrate deploy
is capable enough, or if I need to do something specialNurul
09/01/2022, 4:01 PMHays Clark
09/01/2022, 4:29 PMVarshith Kumar
09/01/2022, 4:48 PMFranklin
09/01/2022, 5:51 PMcreate
*table* asset_collection (
id *integer* auto_increment not null,
department *varchar*(255),
reviewed *varchar*(255),
curr_status *varchar*(255),
bay_location *varchar*(255),
created_by *integer*,
updated_by *integer*,
created_at *datetime*(6),
updated_at *datetime*(6),
location *varchar*(255),
prep *integer*,
case_barcode *varchar*(255),
*constraint* pk_asset_collection *primary*
*key* (id)
); And I want to transform it to a model for prisma.Charlie
09/01/2022, 6:51 PMmodel Album {
id BigInt @id @default(autoincrement())
artist String
title String
genres GenresOnAlbums[]
}
model Genre {
@@map("genres")
id BigInt @id @default(autoincrement())
slug String
genre String
albums GenresOnAlbums[]
@@index([slug])
}
model GenresOnAlbums {
id BigInt @id @default(autoincrement())
albumId BigInt
genreId BigInt
subGenre Boolean @default(false)
rym Boolean @default(false)
albums Album @relation(fields: [albumId], references: [id], onDelete: NoAction, onUpdate: NoAction)
genres Genre @relation(fields: [genreId], references: [id], onDelete: NoAction, onUpdate: NoAction)
}
Charlie
09/01/2022, 6:55 PMsubGenre
when I create the link.
I currently have this, but the subGenre
part is giving an error.
const album = await prisma.album.update({
where: { id: 51 },
data: {
genres: {
connect: { id: 34 },
subGenre: false,
},
},
});
console.log(album);
And below is my schema
model Album {
id BigInt @id @default(autoincrement())
artist String
title String
genres GenresOnAlbums[]
}
model Genre {
id BigInt @id @default(autoincrement())
genre String
albums GenresOnAlbums[]
}
model GenresOnAlbums {
id BigInt @id @default(autoincrement())
albumId BigInt
genreId BigInt
subGenre Boolean @default(false)
albums Album @relation(fields: [albumId], references: [id], onDelete: NoAction, onUpdate: NoAction)
genres Genre @relation(fields: [genreId], references: [id], onDelete: NoAction, onUpdate: NoAction)
}
Hubert Kowalski
09/01/2022, 9:21 PM