mooy bot
12/14/2021, 6:07 AMpreviousTeam
and just directly get players
somehow inside of update?Chris Bitoy
12/14/2021, 8:58 AMmodel Campaign {
id Int @id @default(autoincrement())
campaign_name String @unique @default(uuid())
campaign_type String @default("direct")
owner_id Int @unique @default(1)
start_date DateTime @default(now())
sponsor_id String? @default(cuid())
campaign_details String?
campaign_budget Int?
point_value Int?
s1_points Int?
s2_points Int?
s3_points Int?
s4_points Int?
s1_heading Int?
s2_heading Int?
s3_heading Int?
s4_heading Int?
website_click_points Int?
email_lead_points Int?
grouping String?
campaign_header String?
campaign_thumb String?
web_click Int?
email_lead String?
password String?
a_or_b String?
sibling_id String? @default(cuid())
h Int?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
Error:
32 const campaign = await prisma.campaign.create({
data: {
campaign_name: 'This is Test Campaign',
campaign_type: 'Test type',
+ campaign_details: String,
+ campaign_budget: Int,
+ point_value: Int,
+ s1_points: Int,
+ s2_points: Int,
+ s3_points: Int,
+ s4_points: Int,
+ s1_heading: Int,
+ s2_heading: Int,
+ s3_heading: Int,
+ s4_heading: Int,
+ website_click_points: Int,
+ email_lead_points: Int,
+ grouping: String,
+ campaign_header: String,
+ campaign_thumb: String,
+ web_click: Int,
+ email_lead: String,
+ password: String,
+ a_or_b: String,
+ h: Int,
? owner_id?: String,
? sponsor_id?: String,
? sibling_id?: String,
? createdAt?: DateTime,
? updatedAt?: DateTime
}
})
Argument campaign_details for data.campaign_details is missing.
Argument campaign_budget for data.campaign_budget is missing.
Argument point_value for data.point_value is missing.
Argument s1_points for data.s1_points is missing.
Argument s2_points for data.s2_points is missing.
Argument s3_points for data.s3_points is missing.
Argument s4_points for data.s4_points is missing.
Argument s1_heading for data.s1_heading is missing.
Argument s2_heading for data.s2_heading is missing.
Argument s3_heading for data.s3_heading is missing.
Argument s4_heading for data.s4_heading is missing.
Argument website_click_points for data.website_click_points is missing.
Argument email_lead_points for data.email_lead_points is missing.
Argument grouping for data.grouping is missing.
Argument campaign_header for data.campaign_header is missing.
Argument campaign_thumb for data.campaign_thumb is missing.
Argument web_click for data.web_click is missing.
Argument email_lead for data.email_lead is missing.
Argument password for data.password is missing.
Argument a_or_b for data.a_or_b is missing.
Argument h for data.h is missing.
Note: Lines with + are required, lines with ? are optional.
Nichita Z
12/14/2021, 10:31 AMSlackbot
12/14/2021, 11:27 AMAdrian
12/14/2021, 11:41 AMRune Jørgensen
12/14/2021, 11:52 AMuser
12/14/2021, 1:05 PMrdunk
12/14/2021, 4:45 PMDev__
12/14/2021, 5:05 PM.create
it seems that I cannot use the following combination
.create({
relationAId: id,
relationBId: {
connectOrCreate: ...
}
})
any reason why this isnt made possible?. TS gives me an errorMatt Matheson
12/14/2021, 5:49 PMinclude
? Imagining I have users with posts:
const posts = await prisma.post.findMany({
where: {
userId,
}
});
will return 0 whether a user with the given id exists. I'd like to differentiate between "no posts for this user" and "this user doesn't exist".Yaakov
12/14/2021, 8:31 PMZach
12/14/2021, 8:42 PMΓιώργος Κραχτόπουλος
12/14/2021, 9:18 PMoof2win2
12/14/2021, 9:19 PMmysql
adds the methods inSecre
12/14/2021, 10:46 PMStefan Bajić
12/14/2021, 11:24 PMBrian de la Motte
12/15/2021, 4:28 AMAdrian
12/15/2021, 8:07 AMFishie
12/15/2021, 10:35 AMFishie
12/15/2021, 11:46 AMuser
12/15/2021, 2:20 PMJulien Goux
12/15/2021, 3:59 PMJulien Goux
12/15/2021, 3:59 PMJulien Goux
12/15/2021, 4:00 PMJulien Goux
12/15/2021, 4:00 PMrdunk
12/15/2021, 4:01 PMrdunk
12/15/2021, 7:22 PMupdateMany
to update multiple different records at once? For example I have an array [{ id: 1, name: 'Foo' }, { id: 2, name: 'Bar' }]
that I want to change to [{ id: 1, name: 'FOO' }, { id: 2, name: 'BAR' }]
. Or is updateMany
only used to update records to all have the same given value?rdunk
12/15/2021, 7:30 PMprisma.entity.updateMany([
{
where: {
id: 1,
},
data: {
name: 'FOO'
}
},
{
where: {
id: 2,
},
data: {
name: 'BAR'
}
},
])
Drew Turnblad
12/16/2021, 12:24 AMJordan Vohwinkel
12/16/2021, 2:32 AMconst select = {
id: true,
firstName: true,
middleName: true,
lastName: true,
email: true,
userGroups: {
select: {
groupId: true,
userId: true,
group: {
select: {
id: true,
name: true,
isActive: true
},
where: {
id: 1
}
}
},
where: {
groupId: 1
}
}
}
client.findMany({ select });
the where clause on “userGroups: works perfect, the where clause on “group” does not.
error: Unknown arg where
in select.userGroups.select.group.where for type group. Did you mean select
? Available args:type group {}
Is there a nesting limit?