@bslau/hmm_prisma_schema 1.15.3 → 1.17.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bslau/hmm_prisma_schema",
3
- "version": "1.15.3",
3
+ "version": "1.17.0",
4
4
  "main": "index.js",
5
5
  "author": "CIPA Development Team",
6
6
  "license": "ISC",
@@ -0,0 +1,19 @@
1
+ BEGIN TRY
2
+
3
+ BEGIN TRAN;
4
+
5
+ -- AlterTable
6
+ ALTER TABLE [dbo].[PotMetalPoured] ADD [steelmakingGradeName] NVARCHAR(1000);
7
+
8
+ COMMIT TRAN;
9
+
10
+ END TRY
11
+ BEGIN CATCH
12
+
13
+ IF @@TRANCOUNT > 0
14
+ BEGIN
15
+ ROLLBACK TRAN;
16
+ END;
17
+ THROW
18
+
19
+ END CATCH
@@ -0,0 +1,34 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - A unique constraint covering the columns `[torpedoId,torpedoTimerTypeId]` on the table `TorpedoTimer` will be added. If there are existing duplicate values, this will fail.
5
+
6
+ */
7
+ BEGIN TRY
8
+
9
+ BEGIN TRAN;
10
+
11
+ -- DropForeignKey
12
+ ALTER TABLE [dbo].[TorpedoTimer] DROP CONSTRAINT [TorpedoTimer_torpedoId_fkey];
13
+
14
+ -- DropIndex
15
+ ALTER TABLE [dbo].[TorpedoTimer] DROP CONSTRAINT [TorpedoTimer_torpedoId_key];
16
+
17
+ -- CreateIndex
18
+ ALTER TABLE [dbo].[TorpedoTimer] ADD CONSTRAINT [TorpedoTimer_torpedoId_torpedoTimerTypeId_key] UNIQUE NONCLUSTERED ([torpedoId], [torpedoTimerTypeId]);
19
+
20
+ -- AddForeignKey
21
+ ALTER TABLE [dbo].[TorpedoTimer] ADD CONSTRAINT [TorpedoTimer_torpedoId_fkey] FOREIGN KEY ([torpedoId]) REFERENCES [dbo].[Torpedo]([torpedoId]) ON DELETE NO ACTION ON UPDATE CASCADE;
22
+
23
+ COMMIT TRAN;
24
+
25
+ END TRY
26
+ BEGIN CATCH
27
+
28
+ IF @@TRANCOUNT > 0
29
+ BEGIN
30
+ ROLLBACK TRAN;
31
+ END;
32
+ THROW
33
+
34
+ END CATCH
@@ -399,15 +399,16 @@ model PotMetal {
399
399
 
400
400
  /// **POT METAL POURED**
401
401
  ///
402
- /// Provides information about the pot when it is poured.
402
+ /// Provides information about Pot Metal sub-lots when poured.
403
403
  model PotMetalPoured {
404
- id Int @id @default(autoincrement())
405
- isReturnedSteel Boolean @default(false)
406
- mass Float
407
- potMetalId Int
408
- potMetal PotMetal @relation(references: [id], fields: [potMetalId])
409
- createdAt DateTime @default(now())
410
- updatedAt DateTime @updatedAt
404
+ id Int @id @default(autoincrement())
405
+ isReturnedSteel Boolean @default(false)
406
+ mass Float
407
+ steelmakingGradeName String?
408
+ potMetalId Int
409
+ potMetal PotMetal @relation(references: [id], fields: [potMetalId])
410
+ createdAt DateTime @default(now())
411
+ updatedAt DateTime @updatedAt
411
412
  }
412
413
 
413
414
  /// **STATION**
@@ -473,9 +474,9 @@ model Torpedo {
473
474
  torpedoCycle TorpedoCycle[]
474
475
  torpedoTrips TorpedoTrip[]
475
476
  notifications Notification[]
477
+ torpedoTimer TorpedoTimer[]
476
478
  torpedoState TorpedoState? @relation(fields: [torpedoStateId], references: [id])
477
479
  torpedoStateId Int?
478
- torpedoTimer TorpedoTimer?
479
480
  createdAt DateTime @default(now())
480
481
  updatedAt DateTime @updatedAt
481
482
  }
@@ -572,14 +573,16 @@ model TorpedoState {
572
573
  /// Defines the _Timer_ that tracks and periodically checks specialized _Torpedo_ rules related to different time-based scenarios.
573
574
  model TorpedoTimer {
574
575
  id Int @id @default(autoincrement())
575
- torpedo Torpedo @relation(fields: [torpedoId], references: [id], onDelete: NoAction, onUpdate: Cascade)
576
- torpedoId Int @unique
576
+ torpedo Torpedo @relation(fields: [torpedoId], references: [torpedoId], onDelete: NoAction, onUpdate: Cascade)
577
+ torpedoId Int
577
578
  torpedoTimerType TorpedoTimerType @relation(fields: [torpedoTimerTypeId], references: [id], onDelete: NoAction, onUpdate: Cascade)
578
579
  torpedoTimerTypeId Int
579
580
  startTime DateTime @default(now()) @db.DateTimeOffset
580
581
  startTimeOffset Int @default(0)
581
582
  createdAt DateTime @default(now())
582
583
  updatedAt DateTime @updatedAt
584
+
585
+ @@unique(name: "torpedo_torpedoTimerType_id", [torpedoId, torpedoTimerTypeId])
583
586
  }
584
587
 
585
588
  /// **TORPEDO TIMER**