mirror of
https://github.com/EdiFarcas/Giveaway-app.git
synced 2026-06-28 23:00:55 +03:00
Initial commit - project setup
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
datasource db {
|
||||
provider = "postgresql" // Or your database provider
|
||||
url = env("DATABASE_URL")
|
||||
}
|
||||
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
}
|
||||
|
||||
model User {
|
||||
id String @id @default(cuid())
|
||||
name String?
|
||||
email String? @unique
|
||||
emailVerified DateTime?
|
||||
image String?
|
||||
accounts Account[]
|
||||
sessions Session[]
|
||||
youtubeId String? @unique
|
||||
coins Int @default(0)
|
||||
entries Entry[]
|
||||
}
|
||||
|
||||
model Account {
|
||||
id String @id @default(cuid())
|
||||
userId String
|
||||
type String
|
||||
provider String
|
||||
providerAccountId String
|
||||
refresh_token String? // Optional
|
||||
access_token String? // Optional
|
||||
expires_at Int? // Optional
|
||||
token_type String? // Optional
|
||||
scope String? // Optional
|
||||
id_token String? // Optional
|
||||
session_state String? // Optional
|
||||
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([provider, providerAccountId])
|
||||
}
|
||||
|
||||
model Session {
|
||||
id String @id @default(cuid())
|
||||
sessionToken String @unique
|
||||
userId String
|
||||
expires DateTime
|
||||
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
}
|
||||
|
||||
model VerificationToken {
|
||||
identifier String
|
||||
token String @unique
|
||||
expires DateTime
|
||||
|
||||
@@unique([identifier, token])
|
||||
}
|
||||
|
||||
model Giveaway {
|
||||
id String @id @default(cuid())
|
||||
title String
|
||||
description String
|
||||
value Int @default(0)
|
||||
prize String
|
||||
active Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
entries Entry[]
|
||||
}
|
||||
|
||||
model Entry {
|
||||
id String @id @default(cuid())
|
||||
user User @relation(fields: [userId], references: [id])
|
||||
userId String
|
||||
giveaway Giveaway @relation(fields: [giveawayId], references: [id])
|
||||
giveawayId String
|
||||
weight Float
|
||||
}
|
||||
Reference in New Issue
Block a user