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/.env-dev +1 -2
- package/.env-local +2 -0
- package/.env-prod +3 -0
- package/generated/prisma-client/index-browser.js +4 -1
- package/generated/prisma-client/index.d.ts +530 -645
- package/generated/prisma-client/index.js +6 -3
- package/generated/prisma-client/schema.prisma +20 -16
- package/migrations/20221112124401_init/migration.sql +138 -0
- package/migrations/20221112132548_id_fields_fix_in_cockroachdb/migration.sql +158 -0
- package/migrations/migration_lock.toml +3 -0
- package/package.json +4 -2
- package/schema.prisma +20 -16
package/schema.prisma
CHANGED
|
@@ -10,9 +10,9 @@ datasource db {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
model Card {
|
|
13
|
-
id
|
|
13
|
+
id String @id @default(cuid())
|
|
14
14
|
pack Pack @relation(fields: [packId], references: [id])
|
|
15
|
-
packId
|
|
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
|
|
28
|
+
userId String
|
|
29
29
|
card Card @relation(fields: [cardId], references: [id])
|
|
30
|
-
cardId
|
|
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
|
|
40
|
+
id String @id @default(cuid())
|
|
41
41
|
teacher Teacher @relation(fields: [teacherId], references: [id])
|
|
42
|
-
teacherId
|
|
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
|
|
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
|
|
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
|
|
75
|
+
userId String @unique
|
|
76
76
|
@@map("googleUsers")
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
model Answer {
|
|
80
|
-
id
|
|
80
|
+
id String @id @default(cuid())
|
|
81
81
|
user User @relation(fields: [userId], references: [id])
|
|
82
|
-
userId
|
|
82
|
+
userId String
|
|
83
83
|
card Card @relation(fields: [cardId], references: [id])
|
|
84
|
-
cardId
|
|
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
|
|
91
|
+
id String @id @default(cuid())
|
|
92
92
|
user User @relation(fields: [userId], references: [id])
|
|
93
|
-
userId
|
|
93
|
+
userId String
|
|
94
94
|
pack Pack @relation(fields: [packId], references: [id])
|
|
95
|
-
packId
|
|
96
|
-
|
|
95
|
+
packId String
|
|
96
|
+
currency String
|
|
97
|
+
amount Int
|
|
98
|
+
orderDate DateTime?
|
|
99
|
+
paymentDate DateTime?
|
|
100
|
+
|
|
97
101
|
@@map("purchases")
|
|
98
102
|
}
|