Ivor
07/01/2020, 10:42 AMnpx prisma migrate save --name "add posts" --experimental
» migrate save is not a prisma command
// schema.prisma
model User {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
email String @unique
name String?
role Role @default(USER)
posts Post[]
}
model Post {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @default(now())
title String?
body String?
author User? @relation(fields: [authorId], references: [id])
authorId Int?
}
enum Role {
USER
ADMIN
}Ryan
07/01/2020, 10:56 AM@prisma/cli are you using?Ivor
07/01/2020, 10:58 AMRyan
07/01/2020, 11:00 AMprisma from your packages and just keep @prisma/cli
Also even if you need Prisma 1, you can install it as npm install prisma1.Ivor
07/01/2020, 11:02 AMprisma from global.Ivor
07/01/2020, 11:02 AM