Skip to content

Instantly share code, notes, and snippets.

@kuc-arc-f
Created April 28, 2023 06:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kuc-arc-f/fc0a59e61ad64a002904b48d96fe8d1d to your computer and use it in GitHub Desktop.
Save kuc-arc-f/fc0a59e61ad64a002904b48d96fe8d1d to your computer and use it in GitHub Desktop.
schema.prisma, prisma ORM session table
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
}
model User {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
password String
email String @unique
name String?
}
model Task {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
title String @db.VarChar(255)
content String? @db.Text
userId Int?
}
model Token {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
token String? @db.Text
secret String? @db.Text
expire_datetime DateTime @default(now())
userId Int?
}
model Session {
id Int @id @default(autoincrement())
sessionId String
key String?
value String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment