Michael Buller
01/28/2022, 9:37 PMnpx prisma migrate dev --create-only
Environment variables loaded from .env
Prisma schema loaded from libs\api\core\data-access\src\prisma\schema.prisma
Datasource "db" - SQL Server
Drift detected: Your database schema is not in sync with your migration history.
The following is a summary of the differences between the expected database schema given your migrations files, and the actual schema of the database.
It should be understood as the set of changes to get from the expected schema to the actual schema.
[+] Added tables
• stage_Providers
[*] Changed the ProviderSearch
table
[+] Added column geography
? We need to reset the database.
Do you want to continue? All data will be lost. » (y/N)
My table has geography String? @ignore on it, the geography type is not supported by prisma yet... so have to work around it somehow. How do I tell Prisma not to touch that column and move on? Also, this is a production database and people need to move data into it via different methods. Seen here, there is a stage table that was added. We need a way to ignore that table. Also, don't you think it is odd that your only option you present to the user when a "New" table is added is to DELETE all of the other data from the database? Even if this was development, and we have all of the Prisma seed methods in place, deletion all data doesn't seem like the first choice I would go with.Michael Buller
01/28/2022, 9:54 PMericsonluciano
01/29/2022, 5:59 AM\n
as \\n
? not sure if this is a good solution but on result i made it into value.replace(/\\n/gi, '\n');
James Midzi
01/29/2022, 9:12 AMHarrys Kavan
01/29/2022, 11:56 AMDan Shapir
01/29/2022, 5:06 PMMax Runia
01/29/2022, 7:15 PMapps/**
, and have it's own prisma/schema.prisma
file, since the services will be backend by their own postgres dbs.
For example:
apps/
service1/
src/
...
prisma/
schema.prisma
service2/
src/
...
prisma/
schema.prisma
libs/
...
Has anyone done a setup like this using Nx + Prisma? Are there any gotchas that I'm not foreseeing?André
01/29/2022, 7:40 PMרועי ביתן
01/30/2022, 3:49 PMador
01/30/2022, 4:26 PMnpx prisma migrate dev
for the first time, Prisma will create a database mydb
on the given MySQL server for me, but is there any way I can programmatically create a new database using Prisma or is my only resport to run the command?Nathaniel Babalola
01/30/2022, 5:03 PMFernando Fleury
01/30/2022, 7:48 PM{
score: float;
reviewVotes: ReviewVote[]
}
And the review vote:
{
reviewId: string;
userId: string;
}
When querying the reviews
I wanted to be able to return a "virtual field" hasUserVoted
that would rely on checking whether or not a reviewVote
with its userId
exists. I was trying to figure out how to do this in an optimal wayChris Tsongas
01/31/2022, 3:59 AMVladi Stevanovic
Amit
01/31/2022, 11:13 AMrhel-openssl-1.0.x
binary target.
We're building the docker images in the CI, and sometimes, installing deps and building works just fine, however, the binary is corrupt.
It's only 3 MB in the faulty image
1. Does it happen to someone else?
2. Is there a checksum somewhere that I can validate with?Hemen
01/31/2022, 6:31 PMHarryET
01/31/2022, 7:06 PMJon Insley
01/31/2022, 8:33 PMJoshua Reilly
01/31/2022, 10:12 PMNathaniel Bajo
02/01/2022, 9:57 AMNathaniel Bajo
02/01/2022, 11:27 AMprisma generate
and I don't know what is wrong.Nathaniel Bajo
02/01/2022, 11:28 AMgenerator client {
provider = "prisma-client-js"
output = "../src/generated/client"
engineType = "binary"
binaryTargets = "native"
}
user
02/01/2022, 11:40 AMuser
02/01/2022, 11:52 AMNathaniel Babalola
02/01/2022, 12:32 PMForeign key constraint failed on the field: transactions_senderId_fkey (index)
When I try to insert.
And I have no idea why. There shouldn't be on that field.
Here's my model
model user {
id Int @id @default(autoincrement())
email String @unique
password String
tokens String[]
created_at DateTime @default(now())
updated_at DateTime @updatedAt()
account account?
}
model account {
accNumber Int @id @default(autoincrement())
balance Float
user user @relation(fields: [userId], references: [id], onDelete: Cascade, onUpdate: Cascade)
userId Int @unique
Sender transactions[] @relation("sender")
Receiver transactions[] @relation("receiver")
created_at DateTime @default(now())
updated_at DateTime @updatedAt()
}
model transactions {
id Int @id @default(autoincrement())
txRef String @unique
amount Float
refundRef String? @unique // this will reference a txRef column of a transaction whenn it is a refund
from account @relation("sender", fields: [senderId], references: [accNumber])
senderId Int
to account @relation("receiver", fields: [receiverId], references: [accNumber])
receiverId Int
created_at DateTime @default(now())
updated_at DateTime @updatedAt()
}
Please can anyone see what's wrong with the model?Vlăduț Ilie
02/01/2022, 2:38 PMprisma.users.findFirst({ where: { id: 1, isActive: true }, select: { name: true } });
The default where clause is with AND
or OR
? 🤷🏻♂️Austin Zentz
02/01/2022, 2:39 PMVlăduț Ilie
02/01/2022, 2:40 PMMatheus Assis
02/01/2022, 3:06 PMuser
02/01/2022, 3:30 PM