@bslau/hmm_prisma_schema 1.1.20 → 1.1.21

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bslau/hmm_prisma_schema",
3
- "version": "1.1.20",
3
+ "version": "1.1.21",
4
4
  "main": "index.js",
5
5
  "author": "CIPA Development Team",
6
6
  "license": "ISC",
@@ -0,0 +1,35 @@
1
+ BEGIN TRY
2
+
3
+ BEGIN TRAN;
4
+
5
+ -- CreateTable
6
+ CREATE TABLE [dbo].[EventTorpedoCapacity] (
7
+ [id] INT NOT NULL IDENTITY(1,1),
8
+ [eventId] INT NOT NULL,
9
+ [torpedoId] INT NOT NULL,
10
+ [capacityAverage] FLOAT(53) NOT NULL,
11
+ [dpLevelTldlManual] INT NOT NULL,
12
+ [createdAt] DATETIME2 NOT NULL CONSTRAINT [EventTorpedoCapacity_createdAt_df] DEFAULT CURRENT_TIMESTAMP,
13
+ [updatedAt] DATETIME2 NOT NULL,
14
+ CONSTRAINT [EventTorpedoCapacity_pkey] PRIMARY KEY CLUSTERED ([id]),
15
+ CONSTRAINT [EventTorpedoCapacity_eventId_key] UNIQUE NONCLUSTERED ([eventId])
16
+ );
17
+
18
+ -- AddForeignKey
19
+ ALTER TABLE [dbo].[EventTorpedoCapacity] ADD CONSTRAINT [EventTorpedoCapacity_eventId_fkey] FOREIGN KEY ([eventId]) REFERENCES [dbo].[EventTracker]([id]) ON DELETE NO ACTION ON UPDATE CASCADE;
20
+
21
+ -- AddForeignKey
22
+ ALTER TABLE [dbo].[EventTorpedoCapacity] ADD CONSTRAINT [EventTorpedoCapacity_torpedoId_fkey] FOREIGN KEY ([torpedoId]) REFERENCES [dbo].[Torpedo]([torpedoId]) ON DELETE NO ACTION ON UPDATE CASCADE;
23
+
24
+ COMMIT TRAN;
25
+
26
+ END TRY
27
+ BEGIN CATCH
28
+
29
+ IF @@TRANCOUNT > 0
30
+ BEGIN
31
+ ROLLBACK TRAN;
32
+ END;
33
+ THROW
34
+
35
+ END CATCH
@@ -122,6 +122,21 @@ model EventTorpedoMovement {
122
122
  updatedAt DateTime @updatedAt
123
123
  }
124
124
 
125
+ /// **EVENT TORPEDO CAPACITY**
126
+ ///
127
+ /// Capture the input/output of the Capacity Calculation performed at the end of each Torpedo Trip.
128
+ model EventTorpedoCapacity {
129
+ id Int @id @default(autoincrement())
130
+ event EventTracker @relation(fields: [eventId], references: [id])
131
+ eventId Int @unique
132
+ torpedoId Int
133
+ torpedo Torpedo @relation(fields: [torpedoId], references: [torpedoId])
134
+ capacityAverage Float
135
+ dpLevelTldlManual Int
136
+ createdAt DateTime @default(now())
137
+ updatedAt DateTime @updatedAt
138
+ }
139
+
125
140
  /// **EVENT TRACKER**
126
141
  ///
127
142
  /// Represents a generic system _Event_, which maps to its model instance.
@@ -131,6 +146,7 @@ model EventTracker {
131
146
  eventType String
132
147
  userId String?
133
148
  torpedoMovement EventTorpedoMovement?
149
+ torpedoCapacity EventTorpedoCapacity?
134
150
  }
135
151
 
136
152
  /// **HOT METAL HANDLER COMMENT**
@@ -317,6 +333,7 @@ model Torpedo {
317
333
  torpedoComments TorpedoComment[]
318
334
  hmhComments HMHComment[]
319
335
  eventsTorpedoMovement EventTorpedoMovement[]
336
+ eventTorpedoCapacity EventTorpedoCapacity[]
320
337
  campaignsRebricking CampaignRebricking[]
321
338
  campaignsSurvey CampaignSurvey[]
322
339
  torpedoCycle TorpedoCycle[]