pw change, leaderboard, lotto, related ht, admin ban, add, and display changes
Build Images and Deploy / Update-PROD-Stack (push) Successful in 1m23s
Build Images and Deploy / Update-PROD-Stack (push) Successful in 1m23s
This commit is contained in:
+30
-11
@@ -8,14 +8,16 @@ datasource db {
|
||||
}
|
||||
|
||||
model User {
|
||||
id String @id @default(cuid())
|
||||
username String @unique
|
||||
passwordHash String
|
||||
balance Float @default(2000)
|
||||
researchPoints Int @default(1)
|
||||
isAdmin Boolean @default(false)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
id String @id @default(cuid())
|
||||
username String @unique // lowercase, used for URLs/lookups
|
||||
displayUsername String? // original casing chosen by user
|
||||
passwordHash String
|
||||
balance Float @default(2000)
|
||||
researchPoints Int @default(1)
|
||||
isAdmin Boolean @default(false)
|
||||
lastLotteryAt DateTime? // tracks daily lottery cooldown
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
positions Position[]
|
||||
trades Trade[]
|
||||
@@ -40,18 +42,35 @@ model Hashtag {
|
||||
displayTag String // original case as entered
|
||||
currentPrice Float @default(0.25)
|
||||
isActive Boolean @default(true)
|
||||
isBanned Boolean @default(false)
|
||||
// Consecutive zero-result count; after 3 failed updates the hashtag auto-deactivates
|
||||
zeroCount Int @default(0)
|
||||
lastUpdated DateTime @default(now())
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
priceHistory PriceHistory[]
|
||||
positions Position[]
|
||||
trades Trade[]
|
||||
priceHistory PriceHistory[]
|
||||
positions Position[]
|
||||
trades Trade[]
|
||||
relatedFrom RelatedHashtag[] @relation("RelatedFrom")
|
||||
relatedTo RelatedHashtag[] @relation("RelatedTo")
|
||||
|
||||
@@index([isActive, lastUpdated])
|
||||
}
|
||||
|
||||
model RelatedHashtag {
|
||||
id String @id @default(cuid())
|
||||
hashtagId String
|
||||
hashtag Hashtag @relation("RelatedFrom", fields: [hashtagId], references: [id], onDelete: Cascade)
|
||||
relatedTag String // lowercase tag name (may not yet be in Hashtag table)
|
||||
relatedId String? // set if the related hashtag exists in the DB
|
||||
related Hashtag? @relation("RelatedTo", fields: [relatedId], references: [id], onDelete: SetNull)
|
||||
coOccurrences Int @default(1)
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@unique([hashtagId, relatedTag])
|
||||
@@index([hashtagId, coOccurrences])
|
||||
}
|
||||
|
||||
model PriceHistory {
|
||||
id String @id @default(cuid())
|
||||
hashtagId String
|
||||
|
||||
Reference in New Issue
Block a user