Skip to content

Commit 4cbfe8d

Browse files
authored
chore: refine starter zmodel (#1447)
1 parent debf6ee commit 4cbfe8d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

packages/schema/src/res/starter.zmodel

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ generator client {
1616
* User model
1717
*/
1818
model User {
19-
id String @id @default(cuid())
20-
email String @unique @email
21-
password String @password @omit @length(8, 16)
22-
posts Post[]
19+
id String @id @default(cuid())
20+
email String @unique @email @length(6, 32)
21+
password String @password @omit
22+
posts Post[]
2323

2424
// everybody can signup
2525
@@allow('create', true)
@@ -32,14 +32,14 @@ model User {
3232
* Post model
3333
*/
3434
model Post {
35-
id String @id @default(cuid())
35+
id String @id @default(cuid())
3636
createdAt DateTime @default(now())
3737
updatedAt DateTime @updatedAt
38-
title String @length(1, 256)
39-
content String
40-
published Boolean @default(false)
41-
author User @relation(fields: [authorId], references: [id])
42-
authorId String
38+
title String @length(1, 256)
39+
content String
40+
published Boolean @default(false)
41+
author User @relation(fields: [authorId], references: [id])
42+
authorId String
4343

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

0 commit comments

Comments
 (0)