lang-database 12.0.0 → 12.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/schema.prisma +21 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lang-database",
3
- "version": "12.0.0",
3
+ "version": "12.1.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
package/schema.prisma CHANGED
@@ -31,15 +31,31 @@ model UserCard {
31
31
  card Card @relation(fields: [cardId], references: [id], onDelete: Cascade)
32
32
  cardId String
33
33
  reverse Boolean
34
+
34
35
  done Boolean @default(false)
35
- currentInterval Int?
36
+ currentInterval Int? @db.SmallInt
36
37
  dueDate DateTime?
37
38
 
38
-
39
39
  @@id([userId, cardId, reverse])
40
40
  @@map("userCards")
41
41
  }
42
42
 
43
+ model UserDeck {
44
+ user User @relation(fields: [userId], references: [id])
45
+ userId String
46
+ deck Pack @relation(fields: [deckId], references: [id], onDelete: Cascade)
47
+ deckId String
48
+ reverse Boolean
49
+
50
+ allCards Int @db.SmallInt
51
+ newCards Int @db.SmallInt
52
+ inProgressCards Int @db.SmallInt
53
+ doneCards Int @db.SmallInt
54
+
55
+ @@id([userId, deckId, reverse])
56
+ @@map("userDecks")
57
+ }
58
+
43
59
  model UserStat {
44
60
  user User @relation(fields: [userId], references: [id])
45
61
  userId String
@@ -57,7 +73,7 @@ model UserStat {
57
73
  model Category {
58
74
  id String @id @default(cuid())
59
75
  name String
60
- order Int?
76
+ order Int? @db.SmallInt
61
77
  packs Pack[]
62
78
  @@map("categories")
63
79
  }
@@ -74,8 +90,8 @@ model Pack {
74
90
  published Boolean @default(false)
75
91
  currentPrice Decimal
76
92
  public Boolean @default(false)
93
+ userDecks UserDeck[]
77
94
  cards Card[]
78
- users User[]
79
95
  purchases Purchase[]
80
96
  teams Team[]
81
97
  @@map("packs")
@@ -90,8 +106,8 @@ model User {
90
106
  googleUser GoogleUser?
91
107
  achievements Achievement[]
92
108
  purchases Purchase[]
93
- packs Pack[]
94
109
  userCards UserCard[]
110
+ userDecks UserDeck[]
95
111
  userStat UserStat?
96
112
  userAnswers UserAnswer[]
97
113
  subscriptionExpire DateTime?