Austin Zentz
05/05/2022, 5:42 PMSlackbot
05/05/2022, 7:13 PMEric Simon
05/05/2022, 8:27 PMError: P3016
The fallback method for database resets failed, meaning Migrate could not clean up the database entirely. Original error:
db error: ERROR: cannot drop view geography_columns because extension postgis requires it
HINT: You can drop extension postgis instead.
0: sql_migration_connector::best_effort_reset
at migration-engine/connectors/sql-migration-connector/src/lib.rs:290
1: migration_core::state::DevDiagnostic
at migration-engine/core/src/state.rs:250
My prisma version is:
=> prisma --version
prisma : 3.13.0
@prisma/client : Not found
Current platform : darwin
Query Engine (Node-API) : libquery-engine efdf9b1183dddfd4258cd181a72125755215ab7b (at ../../../../../usr/local/lib/node_modules/prisma/node_modules/@prisma/engines/libquery_engine-darwin.dylib.node)
Migration Engine : migration-engine-cli efdf9b1183dddfd4258cd181a72125755215ab7b (at ../../../../../usr/local/lib/node_modules/prisma/node_modules/@prisma/engines/migration-engine-darwin)
Introspection Engine : introspection-core efdf9b1183dddfd4258cd181a72125755215ab7b (at ../../../../../usr/local/lib/node_modules/prisma/node_modules/@prisma/engines/introspection-engine-darwin)
Format Binary : prisma-fmt efdf9b1183dddfd4258cd181a72125755215ab7b (at ../../../../../usr/local/lib/node_modules/prisma/node_modules/@prisma/engines/prisma-fmt-darwin)
Default Engines Hash : efdf9b1183dddfd4258cd181a72125755215ab7b
Studio : 0.459.0
Dev__
05/06/2022, 9:36 AMprisma
that defined the $transaction
prisma type?
I have instances where I want to pass the transaction's prisma as an argHugo Vallejo
05/06/2022, 3:30 PMHugo Vallejo
05/06/2022, 3:31 PMshahrukh ahmed
05/06/2022, 3:40 PMNic Luciano
05/06/2022, 5:21 PMUserThing
i want userThing
. i can just camelcase-and-pray for now, but i was hoping there was a more coupled-to-Prisma way to get the delegate name? i don't see it in the dmmf document or options
. (which makes sense, because i guess it's more owned by the js client generator than the schema tools...)Carlos Gomez
05/06/2022, 6:27 PMPlease enter a name for the new migration:
when after all migrations have been run for an application and it starts to boot?Wesley
05/06/2022, 8:17 PMWesley
05/06/2022, 8:18 PMWesley
05/06/2022, 8:18 PMWesley
05/06/2022, 8:20 PMJames Kienle
05/07/2022, 6:12 AMpnpm exec prisma generate
I see the following
It looks like prisma isn't resolving properly? I'm honestly not sure and at a bit of a loss for what to do from here š
James Kienle
05/07/2022, 6:13 AM@prisma/client
is a devdependency and peerdependency of packages/some-prisma-helper
and a dependency of apps/my-nextjs-app
, so I'd think the resolution would come from the nextjs app, but I could be wrongBoo
05/07/2022, 6:22 AMid
PK of the table.
like on the table if you have
postId BigInt @map("post_id")
@@id([id, postId])
can i reference this postId
on a relation?user
05/07/2022, 8:00 AMBoo
05/07/2022, 3:54 PMauthorId
and followingId
?
model Users {
id BigInt @id @default(autoincrement())
followers Follows[] @relation("follower")
followings Follows[] @relation("following")
posts Posts[]
createdOn DateTime @default(now()) @map("created_on")
updatedOn DateTime @updatedAt @map("updated_on")
@@map("users")
}
// Following users can have many posts
model Follows {
id BigInt @default(autoincrement())
followerId BigInt @map("follower_id")
followingId BigInt @map("following_id")
follower Users @relation("following", fields: [followerId], references: [id])
following Users @relation("follower", fields: [followingId], references: [id])
followingPosts Posts[]
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @default(now()) @map("updated_at")
@@id([id, followerId, followingId])
@@map("follows")
}
// Posts will always have an authorId
model Posts {
id BigInt @default(autoincrement())
authorId BigInt @map("author_id")
author Users @relation(fields: [authorId], references: [id])
follows Follows @relation(fields: [authorId], references: [followerId])
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @default(now()) @map("updated_at")
@@id([id, authorId])
@@map("bits")
}
// Query should work like this
users.findMany({
where: {
id: 1
},
include: {
followings: { // all posts of the users that I follow
include: {
posts: true
}
}
}
})
user
05/08/2022, 8:00 AMSunal Orhon
05/08/2022, 4:54 PMMoin Akhter
05/08/2022, 7:48 PMPlease provide user name
,
}),
email: Joi.string().empty().email().messages({
"string.empty": Please provide email
,
"string.email": Please provide valid email
,
}),
password: Joi.string().empty().min(8).messages({
"string.empty": Please provide password
,
"string.min": Password must be atleast 8 character long
,
}),
});
const { error, value } = schema.validate(args.data, {
abortEarly: false,
});
const { haveErrors, errors } = createObject(value, error);
if (haveErrors) {
throw new GraphQLYogaError(JSON.stringify(errors));
}
But i'm not getting error object.
Plz help if anyone have idea.
Thanks in advanceBenjamin Indermühle
05/09/2022, 6:25 AMuser
05/09/2022, 8:01 AMKay Khan
05/09/2022, 9:29 AMconst brands = await PrismaService.brand.findMany({
distinct: ["name"],
select: {
id: true,
name: true,
image: {
select: {
source: true,
dtype: true,
},
},
},
});
prisma:info Starting a mysql pool with 9 connections.
prisma:query SELECT `checkpoint_gg`.`brand`.`id`, `checkpoint_gg`.`brand`.`name`, `checkpoint_gg`.`brand`.`image_id` FROM `checkpoint_gg`.`brand` WHERE 1=1
Seems like it does not like joining on that image table any idea why?Daniell
05/09/2022, 9:38 AMprisma1
CLI instead.
You can install it with npm install -g prisma1
.
If you want to upgrade to Prisma 2+, please have a look at our upgrade guide:
http://pris.ly/d/upgrading-to-prisma2
at this step: https://www.prisma.io/docs/guides/upgrade-guides/upgrade-from-prisma-1/upgrading-the-prisma-layer-mysql#2-create-your-prisma-2-schemaMatt
05/09/2022, 2:57 PM2022-05-09T12:25:07.783788Z 1568 [Note] [MY-010914] [Server] Aborted connection 1568 to db: 'xxxxxx' user: 'xxxxxxx' host: 'xx.xx.xx.xx' (Got an error reading communication packets). (<http://sql_connect.cc:835|sql_connect.cc:835>)
Hussam Khatib
05/09/2022, 5:39 PMconst getUser = await prisma.user.findUnique({
where: {
id: 19,
},
select: {
posts: {
select: {
title: true,
},
},
},
})
output
{
posts: { title: 'My first post' }
}
Is there a way to get it like the one shown below ?
{
posts: "My post title"
}
Slackbot
05/09/2022, 11:32 PMYaakov
05/10/2022, 12:04 AMawait prisma.user.update({
where: { id: 1 },
data: {
userRoles: {
deleteMany: {
where: {
role: {
type: 'SOME_ROLE',
},
},
},
},
},
})
PanMan
05/10/2022, 7:54 AMUnique constraint failed on the constraint: `stats_company_id_day_stat_type_context_key`
Isnāt the idea of the upsert it doesnāt fail but does the update, then?? Iām doing:
prisma.stats.upsert({
create: stat,
update: stat,
where: {
company_id_day_stat_type_context: {
company_id: companyId,
day: stat.day,
context: stat.context || "",
stat_type: stat.stat_type,
},
},
});