@bslau/hmm_prisma_schema 1.5.0 → 1.5.1
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/package.json
CHANGED
package/prisma/schema.prisma
CHANGED
|
@@ -498,11 +498,11 @@ model NotificationCategory {
|
|
|
498
498
|
///
|
|
499
499
|
/// These display modes define how these notifications are displayed to the User
|
|
500
500
|
model NotificationDisplay {
|
|
501
|
-
id
|
|
502
|
-
displayModeId
|
|
503
|
-
|
|
504
|
-
notification
|
|
505
|
-
notificationId
|
|
501
|
+
id Int @id @default(autoincrement())
|
|
502
|
+
displayModeId Int
|
|
503
|
+
notificationDisplayMode NotificationDisplayMode @relation(fields: [displayModeId], references: [id])
|
|
504
|
+
notification Notification @relation(fields: [notificationId], references: [id], onDelete: NoAction, onUpdate: Cascade)
|
|
505
|
+
notificationId Int
|
|
506
506
|
// status Boolean @default(false) NOTES: Probably add something like this later to check for example if a notification has been acknowledged by the user
|
|
507
507
|
}
|
|
508
508
|
|
|
@@ -510,11 +510,11 @@ model NotificationDisplay {
|
|
|
510
510
|
///
|
|
511
511
|
/// These are the Defined Display Modes available to the HMM Application
|
|
512
512
|
model NotificationDisplayMode {
|
|
513
|
-
id
|
|
514
|
-
name
|
|
515
|
-
label
|
|
516
|
-
description
|
|
517
|
-
|
|
513
|
+
id Int @id @default(autoincrement())
|
|
514
|
+
name String @unique
|
|
515
|
+
label String
|
|
516
|
+
description String
|
|
517
|
+
notificationDisplays NotificationDisplay[]
|
|
518
518
|
}
|
|
519
519
|
|
|
520
520
|
/// ** HMM Notification Source **
|
package/prisma/seed.ts
CHANGED
|
@@ -2,6 +2,63 @@ import _ from "underscore";
|
|
|
2
2
|
import prisma from "./dbClient";
|
|
3
3
|
|
|
4
4
|
async function main() {
|
|
5
|
+
// SEED: Torpedos
|
|
6
|
+
if ((await prisma.torpedo.count()) > 0) {
|
|
7
|
+
console.log("SEED: Torpedo - skipped.");
|
|
8
|
+
} else {
|
|
9
|
+
console.log("SEED: Torpedo - generating...");
|
|
10
|
+
|
|
11
|
+
const createTorpedo =
|
|
12
|
+
await prisma.torpedo.createMany({
|
|
13
|
+
data: [
|
|
14
|
+
{ torpedoId: 18, name: "Torpedo 18", status: 2 },
|
|
15
|
+
{ torpedoId: 19, name: "Torpedo 19", status: 2 },
|
|
16
|
+
{ torpedoId: 20, name: "Torpedo 20", status: 2 },
|
|
17
|
+
{ torpedoId: 21, name: "Torpedo 21", status: 2 },
|
|
18
|
+
{ torpedoId: 22, name: "Torpedo 22", status: 2 },
|
|
19
|
+
{ torpedoId: 23, name: "Torpedo 23", status: 2 },
|
|
20
|
+
{ torpedoId: 24, name: "Torpedo 24", status: 2 },
|
|
21
|
+
{ torpedoId: 25, name: "Torpedo 25", status: 2 },
|
|
22
|
+
{ torpedoId: 27, name: "Torpedo 27", status: 2 },
|
|
23
|
+
{ torpedoId: 28, name: "Torpedo 28", status: 2 },
|
|
24
|
+
{ torpedoId: 29, name: "Torpedo 29", status: 2 },
|
|
25
|
+
{ torpedoId: 30, name: "Torpedo 30", status: 2 },
|
|
26
|
+
{ torpedoId: 31, name: "Torpedo 31", status: 2 },
|
|
27
|
+
{ torpedoId: 32, name: "Torpedo 32", status: 2 },
|
|
28
|
+
{ torpedoId: 33, name: "Torpedo 33", status: 2 },
|
|
29
|
+
{ torpedoId: 34, name: "Torpedo 34", status: 2 },
|
|
30
|
+
{ torpedoId: 35, name: "Torpedo 35", status: 2 },
|
|
31
|
+
{ torpedoId: 36, name: "Torpedo 36", status: 2 },
|
|
32
|
+
{ torpedoId: 37, name: "Torpedo 37", status: 2 },
|
|
33
|
+
{ torpedoId: 38, name: "Torpedo 38", status: 2 },
|
|
34
|
+
{ torpedoId: 39, name: "Torpedo 39", status: 2 },
|
|
35
|
+
{ torpedoId: 40, name: "Torpedo 40", status: 2 },
|
|
36
|
+
{ torpedoId: 41, name: "Torpedo 41", status: 2 },
|
|
37
|
+
{ torpedoId: 42, name: "Torpedo 42", status: 2 },
|
|
38
|
+
{ torpedoId: 43, name: "Torpedo 43", status: 2 },
|
|
39
|
+
{ torpedoId: 44, name: "Torpedo 44", status: 2 },
|
|
40
|
+
{ torpedoId: 45, name: "Torpedo 45", status: 2 },
|
|
41
|
+
{ torpedoId: 46, name: "Torpedo 46", status: 2 },
|
|
42
|
+
{ torpedoId: 47, name: "Torpedo 47", status: 2 },
|
|
43
|
+
{ torpedoId: 48, name: "Torpedo 48", status: 2 },
|
|
44
|
+
{ torpedoId: 49, name: "Torpedo 49", status: 2 },
|
|
45
|
+
{ torpedoId: 50, name: "Torpedo 50", status: 2 },
|
|
46
|
+
{ torpedoId: 51, name: "Torpedo 51", status: 2 },
|
|
47
|
+
{ torpedoId: 52, name: "Torpedo 52", status: 2 },
|
|
48
|
+
{ torpedoId: 54, name: "Torpedo 54", status: 2 },
|
|
49
|
+
{ torpedoId: 55, name: "Torpedo 55", status: 2 },
|
|
50
|
+
{ torpedoId: 56, name: "Torpedo 56", status: 2 },
|
|
51
|
+
{ torpedoId: 57, name: "Torpedo 57", status: 2 },
|
|
52
|
+
{ torpedoId: 58, name: "Torpedo 58", status: 2 },
|
|
53
|
+
{ torpedoId: 60, name: "Torpedo 60", status: 2 },
|
|
54
|
+
],
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
console.log({
|
|
58
|
+
createTorpedo,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
5
62
|
// SEED: Station
|
|
6
63
|
if ((await prisma.station.count()) > 0) {
|
|
7
64
|
console.log("SEED: Station - skipped.");
|
|
@@ -528,7 +585,7 @@ async function main() {
|
|
|
528
585
|
for (let i: number = 0; i < remainingTorpedoes.length; i++) {
|
|
529
586
|
const randomLocation = await prisma.torpedoLocation.create({
|
|
530
587
|
data: {
|
|
531
|
-
stationId:
|
|
588
|
+
stationId: stationList[0].id,
|
|
532
589
|
position: 2 + i,
|
|
533
590
|
torpedoId: remainingTorpedoes[i].torpedoId,
|
|
534
591
|
locationId: stationList[0].locations[0].id,
|
|
@@ -650,9 +707,9 @@ async function main() {
|
|
|
650
707
|
|
|
651
708
|
// SEED: NotificationDisplay
|
|
652
709
|
if ((await prisma.notificationDisplayMode.count()) > 0) {
|
|
653
|
-
console.log("SEED:
|
|
710
|
+
console.log("SEED: NotificationDisplayMode - skipped.");
|
|
654
711
|
} else {
|
|
655
|
-
console.log("SEED:
|
|
712
|
+
console.log("SEED: NotificationDisplayMode - generating...");
|
|
656
713
|
|
|
657
714
|
const createDisplayMode = await prisma.notificationDisplayMode.createMany({
|
|
658
715
|
data: [
|