@bslau/hmm_prisma_schema 1.20.0 → 1.21.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.20.0",
3
+ "version": "1.21.0",
4
4
  "main": "index.js",
5
5
  "author": "CIPA Development Team",
6
6
  "license": "ISC",
@@ -0,0 +1,29 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - A unique constraint covering the columns `[castSequence,torpedoId]` on the table `HotMetal` will be added. If there are existing duplicate values, this will fail.
5
+ - Made the column `torpedoId` on table `HotMetal` required. This step will fail if there are existing NULL values in that column.
6
+
7
+ */
8
+ BEGIN TRY
9
+
10
+ BEGIN TRAN;
11
+
12
+ -- AlterTable
13
+ ALTER TABLE [dbo].[HotMetal] ALTER COLUMN [torpedoId] INT NOT NULL;
14
+
15
+ -- CreateIndex
16
+ ALTER TABLE [dbo].[HotMetal] ADD CONSTRAINT [HotMetal_castSequence_torpedoId_key] UNIQUE NONCLUSTERED ([castSequence], [torpedoId]);
17
+
18
+ COMMIT TRAN;
19
+
20
+ END TRY
21
+ BEGIN CATCH
22
+
23
+ IF @@TRANCOUNT > 0
24
+ BEGIN
25
+ ROLLBACK TRAN;
26
+ END;
27
+ THROW
28
+
29
+ END CATCH
@@ -236,8 +236,8 @@ model HotMetal {
236
236
  mesId Int?
237
237
  cast Cast @relation(fields: [castSequence], references: [sequenceCastBlastFurnace], onDelete: NoAction, onUpdate: Cascade)
238
238
  castSequence Int
239
- torpedo Torpedo? @relation(fields: [torpedoId], references: [torpedoId], onDelete: NoAction, onUpdate: Cascade)
240
- torpedoId Int?
239
+ torpedo Torpedo @relation(fields: [torpedoId], references: [torpedoId], onDelete: NoAction, onUpdate: Cascade)
240
+ torpedoId Int
241
241
  labResult HotMetalLabResult[]
242
242
  torpedoCycle TorpedoCycle[]
243
243
  torpedoTrip TorpedoTrip[]
@@ -274,6 +274,8 @@ model HotMetal {
274
274
  hotMetalPouredCollection HotMetalPoured[]
275
275
  createdAt DateTime @default(now())
276
276
  updatedAt DateTime @updatedAt
277
+
278
+ @@unique(name: "cast_torpedo_id", [castSequence, torpedoId])
277
279
  }
278
280
 
279
281
  /// **LAB RESULT**