{Pedrolima}
07/29/2022, 6:46 PMGuilherme Nimer
07/29/2022, 8:12 PM0xsapphir3
07/30/2022, 3:25 AMRutik Wankhade
07/30/2022, 6:20 AMChristoffer
07/30/2022, 1:10 PMJayek
07/30/2022, 4:26 PMGeebrox
07/31/2022, 3:10 AM_
) in prisma schema? Currently it throws an error saying that it is invalid fieldViktor Demčák
07/31/2022, 5:48 AMvijay krishna
07/31/2022, 6:15 AMmodel User {
id Bytes @id @db.Binary(16) @default(dbgenerated("(uuid_to_bin(uuid()))"))
email String @unique @db.VarChar(320)
name String?
contact String @db.VarChar(15)
}
Felipe Paz
07/31/2022, 10:38 AMpublishedAt
and it should have the same value that the field createdAt
. I tried publishedAt: DateTime! @default(now())
, publishedAt: DateTime! @default(value: "now()")
, publishedAt: DateTime! @default(value: Date.now())
, publishedAt: DateTime! @default(@createdAt)
and none of this options worked as expected. Is there a possibility to create a DateTime field with a default value without being the createdAt and UpdatedAt fields?Michael Jay
07/31/2022, 3:14 PMprisma db push
to update my db. If I'm understanding correctly, I haven't used my migration file at all.
Since I have a fresh DB, is there anything wrong with deleting my initial migration file since I've made quite a few changes to the Prisma schema that aren't in the initial migration, and since the DB is new?Adimac93
07/31/2022, 3:18 PMUser
Profile
based on Profile[]
available in School
?Logan
08/01/2022, 12:52 AMerror: Error parsing attribute "@default": The function auto is not a known function.
--> schema.prisma:11
|
10 | model Session {
11 | id Bytes @id @default(auto()) @map("_id") @db.ObjectId
If I use dbgenerated
instead, i get told to use auto()
...
I am on version "@prisma/client": "^4.1.1",
Logan
08/01/2022, 12:53 AMJy
08/01/2022, 1:48 AMimage
table that has a many to many relationship with both with users
and figures
.
What I'm trying to accomplish is create those 2 resources with images attached without duplicating image entries. If I can succeed in getting connectOrCreate
to work that would probably be what I need.
As part of my experimenting I created a unique field path_hash
on image
that tries to uniquely identify an image using an md5 hash of the path (since I don't know the id of a potentially pre-existing image as I'm creating it)
Whenever I'm creating a would-be duplicate I get this:
Running seed command `ts-node --compiler-options {"module":"CommonJS"} prisma/seed.ts` ...
PrismaClientKnownRequestError:
Invalid `prisma.user.upsert()` invocation:
Unique constraint failed on the constraint: `PRIMARY`
at RequestHandler.handleRequestError [...removed file path]
code: 'P2002',
clientVersion: '4.1.1',
meta: { target: 'PRIMARY' }
Any ideas? I don't wanna make too much noise in the channel so I can add my models/queries in thread replies if neededPaul Obayuwana
08/01/2022, 10:11 AMAdeodatus Abdul
08/01/2022, 11:13 AMIradukunda Irenee
08/01/2022, 11:16 AMIradukunda Irenee
08/01/2022, 11:16 AMMichael Jay
08/01/2022, 5:14 PMRichard Ward
08/01/2022, 6:54 PMpackage.json
Richard Ward
08/01/2022, 6:55 PM"scripts": {
"postinstall": "prisma generate" # or however you may need to call it, npx prisma generate, etc..
"build": "....",
"start": "...."
}
Alex Vilchis
08/01/2022, 7:51 PMJustin Wenning
08/01/2022, 8:26 PMnpm run db:migrate && npm run db:seed && npm run all:build && node ./dist/server/index.js
). Does anyone have a documented method of getting this to work through platform hooks (or whatever the intended method is)? What I’m doing seems super hacky.Alex Vilchis
08/01/2022, 8:57 PMprisma generate
without throwing an error if the variable DATABASE_URL
is not present? I need to just build my appTrevor Dilley
08/01/2022, 10:45 PMprisma migrate deploy
as one of the first commands during a load balanced deployment (Say AWS ECS with multiple servers) will the multiple servers stomp on each other when deploying to the same database?
In the past I think a Java dev mentioned Flywheel is able to manage migrations on LoadBalanced fleets, so I'm curious if I need a separate pipeline step to deploy migrations before updating servers, or will the first server to come up manage the migration and the other servers will wait for it to complete? Thanks!Michael Jay
08/02/2022, 4:56 AMPieter
08/02/2022, 8:02 AMAdeodatus Abdul
08/02/2022, 8:12 AMMichael Roberts
08/02/2022, 9:55 AM