pw change, leaderboard, lotto, related ht, admin ban, add, and display changes
Build Images and Deploy / Update-PROD-Stack (push) Successful in 1m23s

This commit is contained in:
2026-03-18 17:54:02 -04:00
parent 50ab9b38ac
commit 355a4b1b32
25 changed files with 1442 additions and 45 deletions
+30 -11
View File
@@ -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