Skip to content

Instantly share code, notes, and snippets.

@kuc-arc-f
Last active October 10, 2022 10:42
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/79fc7be9a275d7e695bda51580665035 to your computer and use it in GitHub Desktop.
Save kuc-arc-f/79fc7be9a275d7e695bda51580665035 to your computer and use it in GitHub Desktop.
chat app, prisma migration
// 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 Chat {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
name String @db.Text
content String? @db.Text
userId Int?
}
model ChatPost {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
chatId Int?
userId Int?
title String @db.Text
body String @db.Text
}
model Thread {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
chatId Int?
chatPostId Int?
userId Int?
title String @db.Text
body String @db.Text
}
model BookMark {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
chatId Int?
chatPostId Int?
userId Int?
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment