ExpressJS + Prisma
npm install prisma --save-dev
data/schema.prisma
datasource db {
provider = "sqlite"
url = "file:e.db"
}
generator client {
provider = "prisma-client-js"
}
model note {
id Int @id @default(autoincrement())
content String?
createAt DateTime @default(now())
}
package.json
"prisma": {
"schema": "data/schema.prisma"
}
npx prisma generate
prisma migrate dev --name init
resource link: Concepts | Prisma Docs
创建时间:8/10/2022 10:20:35 AM
修改时间:8/10/2022 10:25:45 AM