Skip to content

Commit

Permalink
merge dev to main (refine starter zmodel) (#1448)
Browse files Browse the repository at this point in the history
  • Loading branch information
ymc9 authored May 13, 2024
2 parents 56e399a + 4cbfe8d commit 3588a36
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions packages/schema/src/res/starter.zmodel
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ generator client {
* User model
*/
model User {
id String @id @default(cuid())
email String @unique @email
password String @password @omit @length(8, 16)
posts Post[]
id String @id @default(cuid())
email String @unique @email @length(6, 32)
password String @password @omit
posts Post[]

// everybody can signup
@@allow('create', true)
Expand All @@ -32,14 +32,14 @@ model User {
* Post model
*/
model Post {
id String @id @default(cuid())
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
title String @length(1, 256)
content String
published Boolean @default(false)
author User @relation(fields: [authorId], references: [id])
authorId String
title String @length(1, 256)
content String
published Boolean @default(false)
author User @relation(fields: [authorId], references: [id])
authorId String

// allow read for all signin users
@@allow('read', auth() != null && published)
Expand Down

0 comments on commit 3588a36

Please sign in to comment.