zenstack
Version:
FullStack enhancement for Prisma ORM: seamless integration from database to UI
44 lines (35 loc) • 1.01 kB
Plain Text
// This is a sample model to get you started.
/// A sample data source using local sqlite db.
datasource db {
provider = 'sqlite'
url = 'file:./dev.db'
}
generator client {
provider = "prisma-client-js"
}
/// User model
model User {
id String
email String
password String
posts Post[]
// everybody can signup
@
// full access by self
@
}
/// Post model
model Post {
id String
createdAt DateTime
updatedAt DateTime
title String
content String
published Boolean
author User
authorId String
// allow read for all signin users
@
// full access by author
@
}