@bslau/hmm_prisma_schema 1.3.1 → 1.3.3
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 +1 -1
- package/prisma/migrations/20250514032403_398503_torpedo_trip_capacity/migration.sql +32 -0
- package/prisma/migrations/20250520012200_station_comment/migration.sql +19 -0
- package/prisma/migrations/20250520233232_station_oos/migration.sql +19 -0
- package/prisma/schema.prisma +5 -0
package/package.json
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Warnings:
|
|
3
|
+
|
|
4
|
+
- A unique constraint covering the columns `[torpedoTripId]` on the table `EventTorpedoCapacity` will be added. If there are existing duplicate values, this will fail.
|
|
5
|
+
- Added the required column `torpedoTripId` to the `EventTorpedoCapacity` table without a default value. This is not possible if the table is not empty.
|
|
6
|
+
|
|
7
|
+
*/
|
|
8
|
+
BEGIN TRY
|
|
9
|
+
|
|
10
|
+
BEGIN TRAN;
|
|
11
|
+
|
|
12
|
+
-- AlterTable
|
|
13
|
+
ALTER TABLE [dbo].[EventTorpedoCapacity] ADD [torpedoTripId] INT NOT NULL;
|
|
14
|
+
|
|
15
|
+
-- CreateIndex
|
|
16
|
+
ALTER TABLE [dbo].[EventTorpedoCapacity] ADD CONSTRAINT [EventTorpedoCapacity_torpedoTripId_key] UNIQUE NONCLUSTERED ([torpedoTripId]);
|
|
17
|
+
|
|
18
|
+
-- AddForeignKey
|
|
19
|
+
ALTER TABLE [dbo].[EventTorpedoCapacity] ADD CONSTRAINT [EventTorpedoCapacity_torpedoTripId_fkey] FOREIGN KEY ([torpedoTripId]) REFERENCES [dbo].[TorpedoTrip]([id]) ON DELETE NO ACTION ON UPDATE CASCADE;
|
|
20
|
+
|
|
21
|
+
COMMIT TRAN;
|
|
22
|
+
|
|
23
|
+
END TRY
|
|
24
|
+
BEGIN CATCH
|
|
25
|
+
|
|
26
|
+
IF @@TRANCOUNT > 0
|
|
27
|
+
BEGIN
|
|
28
|
+
ROLLBACK TRAN;
|
|
29
|
+
END;
|
|
30
|
+
THROW
|
|
31
|
+
|
|
32
|
+
END CATCH
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
BEGIN TRY
|
|
2
|
+
|
|
3
|
+
BEGIN TRAN;
|
|
4
|
+
|
|
5
|
+
-- AlterTable
|
|
6
|
+
ALTER TABLE [dbo].[Station] ADD [oos] BIT NOT NULL CONSTRAINT [Station_oos_df] DEFAULT 0;
|
|
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
|
package/prisma/schema.prisma
CHANGED
|
@@ -131,6 +131,8 @@ model EventTorpedoCapacity {
|
|
|
131
131
|
eventId Int @unique
|
|
132
132
|
torpedoId Int
|
|
133
133
|
torpedo Torpedo @relation(fields: [torpedoId], references: [torpedoId])
|
|
134
|
+
torpedoTrip TorpedoTrip @relation(fields: [torpedoTripId], references: [id])
|
|
135
|
+
torpedoTripId Int @unique
|
|
134
136
|
capacityAverage Float
|
|
135
137
|
dpLevelTldlManual Int
|
|
136
138
|
createdAt DateTime @default(now())
|
|
@@ -323,6 +325,8 @@ model Station {
|
|
|
323
325
|
id Int @id @default(autoincrement())
|
|
324
326
|
name String
|
|
325
327
|
value String @unique
|
|
328
|
+
oos Boolean @default(false)
|
|
329
|
+
comment String?
|
|
326
330
|
createdAt DateTime @default(now())
|
|
327
331
|
updatedAt DateTime @updatedAt
|
|
328
332
|
torpedoLocations TorpedoLocation[]
|
|
@@ -455,6 +459,7 @@ model TorpedoTrip {
|
|
|
455
459
|
hotMetalId Int
|
|
456
460
|
torpedo Torpedo @relation(fields: [torpedoId], references: [torpedoId], onDelete: NoAction, onUpdate: NoAction)
|
|
457
461
|
torpedoId Int
|
|
462
|
+
eventTorpedoCapacity EventTorpedoCapacity?
|
|
458
463
|
eventsTorpedoMovement EventTorpedoMovement[]
|
|
459
464
|
startTime DateTime @default(now()) @db.DateTimeOffset
|
|
460
465
|
endTime DateTime? @db.DateTimeOffset
|