Logan Lee
01/18/2022, 8:15 PMLogan Lee
01/18/2022, 8:16 PMMradul Jain
01/19/2022, 6:41 AMselect
cases.case_number as caseNumber,
inv.invNum,
inv.matNum,
cases.style,
cases.case_sk as caseSk
from fm_invoices_view inv
left join(
select case_number, case_sk, style from cases_details
) cases
on
SUBSTRING(cases.case_number, 0, CHARINDEX('-', cases.case_number)) = inv.matNum
where
inv.invNum = ${filter.invoiceId}
group by
inv.invNum,
cases.case_number,
cases.style,
inv.matNum,
cases.case_sk
Jakub Figlak
01/19/2022, 7:02 AMBenny Kachanovsky
01/19/2022, 8:06 AMautoincrement
means that if you expose these id to your users they can conclude stuff you dont want them to know.
For example, user signs up and get the id of 1234, and then another user signs up he will get 12345.
Now there are 2 stuff your users might know:
1. There are probably about 12345 users in your system
2. This is more important - they can try to impersonate to your users by knowing their id (they know that id 123 probably exists etc)
So the best approach is to avoid predictable entities idsuser
01/19/2022, 8:31 AMBenny Kachanovsky
01/19/2022, 11:05 AMFranco Roura
01/19/2022, 3:14 PMprismaMock
as undefinedMichael Buller
01/19/2022, 5:37 PMMichael Buller
01/19/2022, 5:38 PMMichael Buller
01/19/2022, 5:42 PMmodel Intake {
legalCase LegalCase? @relation("LegalCase_intake")
}
model LegalCase {
...
intakeId String?
intake Intake? @relation(name: "LegalCase_intake", fields: [intakeId], references: [id])
Michael Buller
01/19/2022, 5:46 PMintakeId String? @unique
intake Intake? @relation(name: "LegalCase_intake", fields: [intakeId], references: [id])
Michael Buller
01/19/2022, 5:56 PM{
"errors": [
{
"message": "\nInvalid `prisma.intake.create()` invocation:\n\n\n Unique constraint failed on the constraint: `dbo.LegalCase`",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"created"
],
"extensions": {
"code": "INTERNAL_SERVER_ERROR",
"exception": {
"code": "P2002",
"clientVersion": "3.8.1",
"meta": {
"target": "dbo.LegalCase"
Michael Buller
01/19/2022, 5:57 PMKenneth Gitere
01/19/2022, 6:41 PMMichael Buller
01/19/2022, 6:45 PMMichael Buller
01/19/2022, 6:45 PMAlexander Carney
01/19/2022, 7:37 PMMichael Buller
01/19/2022, 8:33 PMMichael Buller
01/19/2022, 8:33 PMface boy
01/19/2022, 9:30 PMMichael Buller
01/19/2022, 9:50 PMMichael Buller
01/19/2022, 9:50 PMMichael Buller
01/19/2022, 9:51 PMprisma db pull
command of the Prisma CLI. Note that using this command requires your connection URL to be set in your Prisma schema `datasource`.Boo
01/19/2022, 10:26 PMtokenId String @map("token_id") @unique(map: "token_id") @db.VarChar(255)
the @map
and @unique
both mapping to token_id
do i have to @map
here?koenie-06
01/20/2022, 10:40 AMkoenie-06
01/20/2022, 10:41 AMVictor
01/20/2022, 10:47 AMonDelete: Cascade
to the schema.prisma
and pushing these changes to my MySQL database hosted on PlanetScale with npx db push
. I then got the response;
The database is already in sync with the Prisma schema.
I then tried to delete a User
-row, which should have deleted rows in different tables - but it did not. I'm wondering if I have to do something else for the cascading deletes to work on the PlanetScale db?Thibaut De Maerteleire
01/20/2022, 12:16 PM