Nathaniel Babalola
08/10/2021, 8:57 AMmodel Passport {
passportId Int @id @default(autoincrement())
passportNo String
nationality String
issuingCountry String
expiryDate DateTime
gender String
firstName String
lastName String
otherNames String
dateOfBirth String
isTravelCompanion Boolean?
userId Int? // relation scalar field (used in the `@relation` attribute below)
user User? @relation(fields: [userId], references: [id])
//Passport relation
traveller Traveller?
@@map(name: "passport")
}
model Traveller {
travellerId Int @id @default(autoincrement())
title String
firstName String
lastName String
countryCode String
phoneNo String
address String
state String
country String
bookingRef String
travellerType String? @default("adult")
price String
currency String
isUser Boolean @default(false)
userId Int? // relation scalar field (used in the '@relation()` attribute below)
user User? @relation(fields: [userId], references: [id])
flightBooking FlighBooking @relation(fields: [bookingRef], references: [bookingRef])
// passport relations
passportId Int
passport Passport @relation(fields: [passportId], references: [passportId])
@@map(name: "traveller")
}
but it shows this error when i run migrate,
Error:
:warning: We found changes that cannot be executed:
`• Step 1 Added the required column passportId
to the traveller
table without a default value. There are 15 rows in this table, it is not possible to execute this step.`
can someone please tell where I went wrong ?Aleksandra Jovanović
08/10/2021, 9:25 AMPaul
08/10/2021, 9:26 AMNathaniel Babalola
08/10/2021, 9:36 AMPaul
08/10/2021, 9:41 AMPaul
08/10/2021, 9:41 AMNathaniel Babalola
08/10/2021, 9:42 AMPaul
08/10/2021, 9:46 AM