@juliobrim/prisma-shared 1.0.46 → 1.0.47
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.
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
-- AlterTable
|
|
2
|
+
ALTER TABLE "productivity_interval_cache" ADD COLUMN "productionOrderId" TEXT;
|
|
3
|
+
|
|
4
|
+
-- AddForeignKey
|
|
5
|
+
ALTER TABLE "productivity_interval_cache" ADD CONSTRAINT "productivity_interval_cache_productionOrderId_fkey" FOREIGN KEY ("productionOrderId") REFERENCES "production_order"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
package/package.json
CHANGED
package/schema.prisma
CHANGED
|
@@ -649,26 +649,27 @@ model ProductionNode {
|
|
|
649
649
|
}
|
|
650
650
|
|
|
651
651
|
model ProductionOrder {
|
|
652
|
-
id String
|
|
652
|
+
id String @id @default(cuid())
|
|
653
653
|
productId String
|
|
654
654
|
flowId String?
|
|
655
|
-
productionOrderIndex Int?
|
|
655
|
+
productionOrderIndex Int? @unique
|
|
656
656
|
batchSize Float
|
|
657
|
-
hasStarted Boolean
|
|
658
|
-
isRunning Boolean
|
|
659
|
-
isFinished Boolean
|
|
657
|
+
hasStarted Boolean @default(false)
|
|
658
|
+
isRunning Boolean @default(false)
|
|
659
|
+
isFinished Boolean @default(false)
|
|
660
660
|
tenantId String?
|
|
661
|
-
endDate DateTime?
|
|
662
|
-
expectedEndDate DateTime?
|
|
663
|
-
startDate DateTime?
|
|
661
|
+
endDate DateTime? @db.Date
|
|
662
|
+
expectedEndDate DateTime? @db.Date
|
|
663
|
+
startDate DateTime? @db.Date
|
|
664
664
|
inputRegisters InputRegister[]
|
|
665
665
|
ItemsHandlingRegister ItemsHandlingRegister[]
|
|
666
666
|
NodeOperationQueue NodeOperationQueue[]
|
|
667
667
|
operationRegisters OperationRegister[]
|
|
668
668
|
productionNode ProductionNode[]
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
669
|
+
productivityIntervals ProductivityIntervalCache[]
|
|
670
|
+
flow Flow? @relation(fields: [flowId], references: [id])
|
|
671
|
+
Product Product @relation(fields: [productId], references: [id])
|
|
672
|
+
tenant Tenant? @relation(fields: [tenantId], references: [id], onDelete: Cascade)
|
|
672
673
|
|
|
673
674
|
@@index([tenantId, isFinished])
|
|
674
675
|
@@index([productId])
|
|
@@ -1048,11 +1049,13 @@ model MachineOperationStitch {
|
|
|
1048
1049
|
}
|
|
1049
1050
|
|
|
1050
1051
|
model ProductivityIntervalCache {
|
|
1051
|
-
id
|
|
1052
|
-
tenantId
|
|
1053
|
-
machineId
|
|
1054
|
-
operatorId
|
|
1055
|
-
operationId
|
|
1052
|
+
id String @id @default(cuid())
|
|
1053
|
+
tenantId String?
|
|
1054
|
+
machineId String
|
|
1055
|
+
operatorId String
|
|
1056
|
+
operationId String?
|
|
1057
|
+
productionOrderId String?
|
|
1058
|
+
|
|
1056
1059
|
sequenceId Int @map("sequence_id")
|
|
1057
1060
|
groupStartTimestamp DateTime @map("group_start_timestamp")
|
|
1058
1061
|
groupEndTimestamp DateTime @map("group_end_timestamp")
|
|
@@ -1067,10 +1070,11 @@ model ProductivityIntervalCache {
|
|
|
1067
1070
|
|
|
1068
1071
|
createdAt DateTime @default(now())
|
|
1069
1072
|
|
|
1070
|
-
tenant
|
|
1071
|
-
machine
|
|
1072
|
-
operator
|
|
1073
|
-
operation
|
|
1073
|
+
tenant Tenant? @relation(fields: [tenantId], references: [id], onDelete: Cascade)
|
|
1074
|
+
machine Machine @relation(fields: [machineId], references: [id], onDelete: Cascade)
|
|
1075
|
+
operator Operator @relation(fields: [operatorId], references: [id], onDelete: Cascade)
|
|
1076
|
+
operation Operation? @relation(fields: [operationId], references: [id], onDelete: Cascade)
|
|
1077
|
+
productionOrder ProductionOrder? @relation(fields: [productionOrderId], references: [id], onDelete: Cascade)
|
|
1074
1078
|
|
|
1075
1079
|
@@unique([machineId, groupStartTimestamp])
|
|
1076
1080
|
@@index([tenantId, machineId, groupStartTimestamp])
|