Quentin Laffont
03/12/2022, 10:12 PMKevin Lanthier
03/16/2022, 5:50 PMmigrate deploy
or migrate dev
, Prisma fails to do so and attempts to remove my constraints.
It works when seeding from scratch, the constraint is picked-up and applied as part of the migration process, but past that whenever creating new migrations or just trying to apply a new one, I get into the same use case.
from my understanding, since it's manually added, the schema is unaware of that constraint, but due to the use case of that constraint, I cannot add that to the schema itself.
Thoughts ?Adam
04/01/2022, 8:14 PMv3.11.0
from v2.27.0
using Postgres and we just created our first migration file using npx prisma migrate dev --name test_migration_file --create-only
and we are noticing a ton of changes that seem to drop all foreign key constraints and re-add them. Is this typical? Is this a cause of the version upgrade?Chris
04/05/2022, 4:30 PMtornros
04/14/2022, 6:22 AMChris Gurba
04/14/2022, 5:48 PMalexwasik
04/14/2022, 8:04 PMnpx prisma migrate deploy
and it completes the task. Of course i hit the endpoint locally, I get a response. I hit the prod endpoint and get Error: TypeError: Cannot read property 'findMany' of undefined
Kasir Barati
04/21/2022, 12:55 PMnpx prisma migrate --create-only
?
I have to do it but I do not know how should I do it.Casey Chow
04/21/2022, 4:34 PMMakefile
target specificallyl for this:
migration: ## create a new schema migration
npx prisma migrate dev --create-only
Geo
04/22/2022, 2:51 PMRunning generate... (Use --skip-generate to skip the generators)
Error: Schema parsing
error: Attribute not known: "@db.Text".
--> schema.prisma:54
|
53 | study_id String?
54 | type EmbedType @db.Text
Paul
04/30/2022, 9:05 PMJonathan Gotti
05/04/2022, 7:44 PMJacob Coker-Dukowitz
05/06/2022, 6:07 PMPrisma Migrate makes use of advisory locking when you run production commands like: prisma migrate deploy
.
Therefore, if I call prisma migrate deploy
when my application is started, and there are multiple containers being deployed at the same time, other containers will sit on that advisory lock and not try to run migrations concurrently. Is that accurate?Wade McDaniel
05/10/2022, 6:10 PMprisma migrate
data migration in MySQL, how do I generate a "Prisma" ID - you know, one that looks like cl30ffuzq04558gfz8s0gi65y
?
Is there a utility in MySQL, or maybe a stored-procedure I can create that generates compatible values to those Prisma generates?Mathieu
05/23/2022, 9:31 PMmodel User {
id String @id(map: "PK_cace4a159ff9f2512dd42373760") @default(dbgenerated("gen_random_uuid()")) @db.Uuid
username String @unique(map: "UQ_78a916df40e02a9deb1c4b75edb") @db.VarChar
email String? @unique(map: "UQ_e12875dfb3b1d92d7d7c5377e22") @db.VarChar
password String @db.VarChar
sheet Sheet[]
@@index([username], map: "username-idx")
@@map("user")
}
model Sheet {
id String @id() @default(dbgenerated("gen_random_uuid()")) @db.Uuid
author User @relation(fields: [authorId], references: [id])
authorId String @db.Uuid
name String @unique() @db.VarChar(512)
slug String @unique() @db.VarChar(512)
}
When running npx prisma migrate dev --name sheets
I get:
Migration `20220523212222_sheets` failed to apply cleanly to the shadow database.
Error:
db error: ERROR: foreign key constraint "Sheet_authorId_fkey" cannot be implemented
DETAIL: Key columns "authorId" and "id" are of incompatible types: text and uuid.
But I thought this line in the Sheet model was correct?
authorId String @db.Uuid
spohl
05/25/2022, 8:22 AMRahul Taing
05/25/2022, 11:14 PMArkadiusz Dyczkowski
05/26/2022, 9:07 AMColumnName Table1 @relation(fields: [ColumnNameId], references: [Id], name: "FirstParameterExactNameSpecifyInTable1")
ColumnName2 Table1 @relation(fields: [ColumnName2Id], references: [Id], name: "SecondParameterExactNameSpecifyInTable1")
Table1 Receiver lets say
FirstParameterExactNameSpecifyInTable1 Organization[] @relation("FirstParameterExactNameSpecifyInTable1")
SecondParameterExactNameSpecifyInTable1 Organization[] @relation("SecondParameterExactNameSpecifyInTable1")
Meybe some of you could point me direction where could i find solution?Arkadiusz Dyczkowski
05/26/2022, 9:59 AMRahul Taing
05/27/2022, 10:13 PMcannot be rolled back because it is not in a failed state.
error. What are the right steps to mark it as rolled back in _prisma_migration table._Roryl
06/02/2022, 10:10 PMprisma migrate deploy
to fail?Stephane Le Dorze
06/05/2022, 1:48 PMLuan Rodrigues
06/20/2022, 6:02 PMNoctera
06/27/2022, 2:33 PMpmaneesh03
07/05/2022, 10:14 AMOliver
07/07/2022, 12:56 PMmigrations/
folder. I also have the backend running in production and it seems like somewhere along the line, the production Prisma DB migrations diverged from the one in the github repository. The production migrations seem to contain a migration that is not in the version controlled migrations/
folder.
It looks like the actual DB schemas are sync, but the migrations arent. Is there a way to sync them?
ThanksLee
07/07/2022, 1:08 PMAdam
07/12/2022, 2:12 AMmigration.sql
file, and deleted the record in _prisma_migrations
and tried to re-deploy but it didn’t work.
My flow now is to restore the db to the point before I deployed the broken migration, but it would be nice if there was a easier way to simply remove a migration and not do it before it goes to a higher level environmentBarnaby
07/20/2022, 3:47 PMBarnaby
07/20/2022, 3:48 PMprisma migrate deploy
before the app starts up - is there a way to just grab the Rust binary directly and execute that?