Maciek K
10/19/2021, 12:48 PMmodel Booking {
id String @id @default(cuid()) @db.VarChar(30)
name String
forename String?
email String?
phone String?
}
to:
model Booking {
id String @id @default(cuid()) @db.VarChar(30)
clientId String
client Client @relation(fields: [clientId], references: [id])
}
model Client {
id String @id @default(cuid()) @db.VarChar(30)
name String
forename String?
email String?
phone String?
bookings Booking[]
}
I'm asking for the best way to approach this mostly in terms of the whole process and modifying the staging, production databases afterwards.
Are there some script examples using prisma to modify the whole database? Couldn't find anything on the Prisma page except the seed scripts.
Is there anything else I should consider by doing such normalisation. Any pitfalls I should be aware of? Thank You :)Ryan
10/19/2021, 1:03 PMBooking
as the data has been migrated.