lang-database 1.4.0 → 1.6.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.
package/schema.prisma CHANGED
@@ -10,9 +10,9 @@ datasource db {
10
10
  }
11
11
 
12
12
  model Card {
13
- id Int @id @default(autoincrement())
13
+ id String @id @default(cuid())
14
14
  pack Pack @relation(fields: [packId], references: [id])
15
- packId Int
15
+ packId String
16
16
  front String
17
17
  back String
18
18
  userCards UserCard[]
@@ -25,9 +25,9 @@ model Card {
25
25
 
26
26
  model UserCard {
27
27
  user User @relation(fields: [userId], references: [id])
28
- userId Int
28
+ userId String
29
29
  card Card @relation(fields: [cardId], references: [id])
30
- cardId Int
30
+ cardId String
31
31
  currentInterval Int?
32
32
  dueDate DateTime?
33
33
  done Boolean
@@ -37,9 +37,9 @@ model UserCard {
37
37
  }
38
38
 
39
39
  model Pack {
40
- id Int @id @default(autoincrement())
40
+ id String @id @default(cuid())
41
41
  teacher Teacher @relation(fields: [teacherId], references: [id])
42
- teacherId Int
42
+ teacherId String
43
43
  name String
44
44
  cards Card[]
45
45
  users User[]
@@ -49,7 +49,7 @@ model Pack {
49
49
  }
50
50
 
51
51
  model User {
52
- id Int @id @default(autoincrement())
52
+ id String @id @default(cuid())
53
53
  email String @unique(map: "IX_Users_Email")
54
54
  name String
55
55
  googleUser GoogleUser?
@@ -61,7 +61,7 @@ model User {
61
61
  }
62
62
 
63
63
  model Teacher {
64
- id Int @id @default(autoincrement())
64
+ id String @id @default(cuid())
65
65
  email String @unique(map: "IX_teachers_Email")
66
66
  name String
67
67
  password String
@@ -72,27 +72,31 @@ model Teacher {
72
72
  model GoogleUser {
73
73
  id String @id
74
74
  user User @relation(fields: [userId], references: [id])
75
- userId Int @unique
75
+ userId String @unique
76
76
  @@map("googleUsers")
77
77
  }
78
78
 
79
79
  model Answer {
80
- id Int @id @default(autoincrement())
80
+ id String @id @default(cuid())
81
81
  user User @relation(fields: [userId], references: [id])
82
- userId Int
82
+ userId String
83
83
  card Card @relation(fields: [cardId], references: [id])
84
- cardId Int
84
+ cardId String
85
85
  status String
86
86
  timestamp String
87
87
  @@map("answers")
88
88
  }
89
89
 
90
90
  model Purchase {
91
- id Int @id @default(autoincrement())
91
+ id String @id @default(cuid())
92
92
  user User @relation(fields: [userId], references: [id])
93
- userId Int
93
+ userId String
94
94
  pack Pack @relation(fields: [packId], references: [id])
95
- packId Int
96
- price String
95
+ packId String
96
+ currency String
97
+ amount Int
98
+ orderDate DateTime?
99
+ paymentDate DateTime?
100
+
97
101
  @@map("purchases")
98
102
  }