mirror of
https://github.com/SrIzan10/hackymarket.git
synced 2026-06-06 00:56:52 +00:00
45 lines
1.1 KiB
Plaintext
45 lines
1.1 KiB
Plaintext
// This is your Prisma schema file,
|
|
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
|
|
|
// Get a free hosted Postgres database in seconds: `npx create-db`
|
|
|
|
generator client {
|
|
provider = "prisma-client"
|
|
output = "../src/generated/prisma"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
}
|
|
|
|
model User {
|
|
id Int @id @default(autoincrement())
|
|
hcaId String @unique
|
|
publicKey String @unique
|
|
slackId String @unique
|
|
username String @unique
|
|
email String @unique
|
|
|
|
sessions Session[]
|
|
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|
|
|
|
// if userid is null, the session is anonymous and will be authenticated.
|
|
model Session {
|
|
id Int @id @default(autoincrement())
|
|
userId Int? @unique
|
|
user User? @relation(fields: [userId], references: [id])
|
|
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|
|
|
|
model CreateAccount {
|
|
id Int @id @default(autoincrement())
|
|
code String @unique
|
|
publicKey String @unique
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
} |