|
|
@@ -20,6 +20,8 @@ model User {
|
|
|
createdAt DateTime @default(now())
|
|
|
updatedAt DateTime @updatedAt
|
|
|
usedAudioMinutes Int @default(0)
|
|
|
+ costLimit Float @default(0)
|
|
|
+ quotaReserved Float @default(0)
|
|
|
subscriptionResetDate DateTime?
|
|
|
comments Comment[]
|
|
|
drafts Draft[]
|
|
|
@@ -33,6 +35,9 @@ model User {
|
|
|
tokenBalance TokenBalance?
|
|
|
tokenUsages TokenUsage[]
|
|
|
preferences UserPreference?
|
|
|
+ shareRecords ShareRecord[]
|
|
|
+ invitesSent InviteRecord[] @relation("InviterRelation")
|
|
|
+ invitesReceived InviteRecord[] @relation("InviteeRelation")
|
|
|
|
|
|
@@index([phone])
|
|
|
@@index([openid])
|
|
|
@@ -183,6 +188,7 @@ model BookChapter {
|
|
|
isPublic Boolean @default(false)
|
|
|
genStage String @default("idle")
|
|
|
lrcLyrics String? @db.Text
|
|
|
+ contentCheck String? @db.Text
|
|
|
book Book @relation(fields: [bookId], references: [id], onDelete: Cascade)
|
|
|
comments Comment[]
|
|
|
playRecords PlayRecord[]
|
|
|
@@ -523,3 +529,41 @@ model Feedback {
|
|
|
@@index([status])
|
|
|
@@index([createdAt])
|
|
|
}
|
|
|
+
|
|
|
+model ShareRecord {
|
|
|
+ id Int @id @default(autoincrement())
|
|
|
+ userId Int
|
|
|
+ audioId Int
|
|
|
+ platform String
|
|
|
+ shareCode String @unique
|
|
|
+ createdAt DateTime @default(now())
|
|
|
+ user User @relation(fields: [userId], references: [id])
|
|
|
+
|
|
|
+ @@index([userId])
|
|
|
+ @@index([shareCode])
|
|
|
+}
|
|
|
+
|
|
|
+model InviteRecord {
|
|
|
+ id Int @id @default(autoincrement())
|
|
|
+ inviterId Int
|
|
|
+ inviteeId Int @unique
|
|
|
+ shareCode String?
|
|
|
+ rewarded Boolean @default(false)
|
|
|
+ createdAt DateTime @default(now())
|
|
|
+ inviter User @relation("InviterRelation", fields: [inviterId], references: [id])
|
|
|
+ invitee User @relation("InviteeRelation", fields: [inviteeId], references: [id])
|
|
|
+
|
|
|
+ @@index([inviterId])
|
|
|
+ @@index([shareCode])
|
|
|
+}
|
|
|
+
|
|
|
+model TokenPackPurchase {
|
|
|
+ id Int @id @default(autoincrement())
|
|
|
+ userId Int
|
|
|
+ packMinutes Int
|
|
|
+ quantity Int
|
|
|
+ unitPrice Float
|
|
|
+ totalAmount Float
|
|
|
+ addedQuota Float
|
|
|
+ createdAt DateTime @default(now())
|
|
|
+}
|