Skip to content

Commit

Permalink
fixing schema and updating readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jowo-io committed Oct 20, 2024
1 parent 7d719e6 commit 0465612
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 27 deletions.
3 changes: 3 additions & 0 deletions examples/prisma/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@ next-env.d.ts

# env
.env

# prisma
prisma/migrations/**
2 changes: 2 additions & 0 deletions examples/prisma/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ Along side the `.env.example` file in this example app, create a `.env` file wit

Run `npm i` to install dependencies.

Run `npm run db:generate` and `npm run db:migrate`

Run `npm run dev` to launch the dev server and visit `localhost:3000` to view the app.
2 changes: 1 addition & 1 deletion examples/prisma/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"lint": "next lint",
"db:init": "prisma init",
"db:generate": "prisma generate",
"db:migrate": "prisma migrate dev --name init"
"db:migrate": "prisma migrate dev"
},
"dependencies": {
"@next-auth/prisma-adapter": "^1.0.7",
Expand Down
54 changes: 28 additions & 26 deletions examples/prisma/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -19,51 +19,53 @@ model Pubkey {
}

model Account {
id String @id @default(cuid())
userId String
providerType String
providerId String
providerAccountId String
refreshToken String?
accessToken String?
accessTokenExpires DateTime?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
user User @relation(fields: [userId], references: [id])
id String @id @default(cuid())
userId String @map("user_id")
type String
provider String
providerAccountId String @map("provider_account_id")
refresh_token String? @db.Text
access_token String? @db.Text
expires_at Int?
token_type String?
scope String?
id_token String? @db.Text
session_state String?
success Boolean?
@@unique([providerId, providerAccountId])
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@unique([provider, providerAccountId])
@@map("accounts")
}

model Session {
id String @id @default(cuid())
userId String
sessionToken String @unique @map("session_token")
userId String @map("user_id")
expires DateTime
sessionToken String @unique
accessToken String @unique
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
user User @relation(fields: [userId], references: [id])
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@map("sessions")
}

model User {
id String @id @default(cuid())
name String?
email String? @unique
emailVerified DateTime?
emailVerified DateTime? @map("email_verified")
image String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
accounts Account[]
sessions Session[]
@@map("users")
}

model VerificationRequest {
id String @id @default(cuid())
model VerificationToken {
identifier String
token String @unique
token String
expires DateTime
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@unique([identifier, token])
@@map("verification_tokens")
}

0 comments on commit 0465612

Please sign in to comment.