@juliobrim/prisma-shared 1.0.24 → 1.0.26
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/migrations/20251027160855_add_operation_and_production_order_to_input_register/migration.sql
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
-- AlterTable
|
|
2
|
+
ALTER TABLE "public"."input_register" ADD COLUMN "operationId" TEXT,
|
|
3
|
+
ADD COLUMN "productionOrderId" TEXT;
|
|
4
|
+
|
|
5
|
+
-- AddForeignKey
|
|
6
|
+
ALTER TABLE "public"."input_register" ADD CONSTRAINT "input_register_operationId_fkey" FOREIGN KEY ("operationId") REFERENCES "public"."operation"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
7
|
+
|
|
8
|
+
-- AddForeignKey
|
|
9
|
+
ALTER TABLE "public"."input_register" ADD CONSTRAINT "input_register_productionOrderId_fkey" FOREIGN KEY ("productionOrderId") REFERENCES "public"."production_order"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
package/package.json
CHANGED
package/schema.prisma
CHANGED
|
@@ -173,16 +173,20 @@ model Follower {
|
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
model InputRegister {
|
|
176
|
-
id
|
|
177
|
-
in1Count
|
|
178
|
-
in2Count
|
|
179
|
-
in3Count
|
|
180
|
-
in4Count
|
|
181
|
-
timestamp
|
|
182
|
-
machineId
|
|
183
|
-
tenantId
|
|
184
|
-
|
|
185
|
-
|
|
176
|
+
id Int @id @default(autoincrement())
|
|
177
|
+
in1Count BigInt @map("in1_count")
|
|
178
|
+
in2Count BigInt @map("in2_count")
|
|
179
|
+
in3Count BigInt @map("in3_count")
|
|
180
|
+
in4Count BigInt @map("in4_count")
|
|
181
|
+
timestamp DateTime @default(now())
|
|
182
|
+
machineId String
|
|
183
|
+
tenantId String?
|
|
184
|
+
operationId String?
|
|
185
|
+
productionOrderId String?
|
|
186
|
+
machine Machine @relation(fields: [machineId], references: [id], onDelete: Cascade)
|
|
187
|
+
tenant Tenant? @relation(fields: [tenantId], references: [id], onDelete: Cascade)
|
|
188
|
+
operation Operation? @relation(fields: [operationId], references: [id], onDelete: Cascade)
|
|
189
|
+
productionOrder ProductionOrder? @relation(fields: [productionOrderId], references: [id], onDelete: Cascade)
|
|
186
190
|
|
|
187
191
|
@@map("input_register")
|
|
188
192
|
}
|
|
@@ -231,32 +235,33 @@ model ItemsHandlingRegister {
|
|
|
231
235
|
}
|
|
232
236
|
|
|
233
237
|
model Machine {
|
|
234
|
-
id
|
|
235
|
-
model
|
|
236
|
-
name
|
|
237
|
-
capacity
|
|
238
|
-
clp_index
|
|
239
|
-
acquired_date
|
|
240
|
-
macAddress
|
|
241
|
-
isDeleted
|
|
242
|
-
type
|
|
243
|
-
sectorId
|
|
244
|
-
tenantId
|
|
245
|
-
downtime
|
|
246
|
-
followers
|
|
247
|
-
inputRegisters
|
|
248
|
-
stationFrom
|
|
249
|
-
stationTo
|
|
250
|
-
sector
|
|
251
|
-
tenant
|
|
252
|
-
operationRegister
|
|
253
|
-
productionNodes
|
|
254
|
-
operationResources
|
|
255
|
-
IotMessageRegister
|
|
256
|
-
MachineFormula
|
|
257
|
-
MachineFormulaResult
|
|
258
|
-
device
|
|
259
|
-
machineSensors
|
|
238
|
+
id String @id @default(cuid())
|
|
239
|
+
model String? @db.VarChar(100)
|
|
240
|
+
name String @unique @db.VarChar(100)
|
|
241
|
+
capacity Float? @db.Real
|
|
242
|
+
clp_index String?
|
|
243
|
+
acquired_date DateTime? @db.Date
|
|
244
|
+
macAddress String? @db.VarChar(17)
|
|
245
|
+
isDeleted Boolean @default(false)
|
|
246
|
+
type MachineType? @default(discrete)
|
|
247
|
+
sectorId String?
|
|
248
|
+
tenantId String?
|
|
249
|
+
downtime DowntimeEvent[]
|
|
250
|
+
followers Follower[]
|
|
251
|
+
inputRegisters InputRegister[]
|
|
252
|
+
stationFrom ItemsHandlingRegister[] @relation("stationFrom")
|
|
253
|
+
stationTo ItemsHandlingRegister[] @relation("stationTo")
|
|
254
|
+
sector Sector? @relation(fields: [sectorId], references: [id])
|
|
255
|
+
tenant Tenant? @relation(fields: [tenantId], references: [id], onDelete: Cascade)
|
|
256
|
+
operationRegister OperationRegister[]
|
|
257
|
+
productionNodes ProductionNode?
|
|
258
|
+
operationResources Resource[] @relation("MachineToResource")
|
|
259
|
+
IotMessageRegister IotMessageRegister[]
|
|
260
|
+
MachineFormula MachineFormula[]
|
|
261
|
+
MachineFormulaResult MachineFormulaResult[]
|
|
262
|
+
device Device?
|
|
263
|
+
machineSensors MachineSensors?
|
|
264
|
+
MachineProcessingScript MachineProcessingScript?
|
|
260
265
|
|
|
261
266
|
@@map("machine")
|
|
262
267
|
}
|
|
@@ -362,6 +367,7 @@ model Operation {
|
|
|
362
367
|
downtimeEvents DowntimeEvent[]
|
|
363
368
|
itemsHandlingRegisters ItemsHandlingRegister[]
|
|
364
369
|
nodeOperationQueue NodeOperationQueue[]
|
|
370
|
+
inputRegisters InputRegister[]
|
|
365
371
|
node Node @relation(fields: [nodeId], references: [id], onDelete: Cascade)
|
|
366
372
|
resource Resource @relation(fields: [resourceId], references: [id])
|
|
367
373
|
tenant Tenant? @relation(fields: [tenantId], references: [id], onDelete: Cascade)
|
|
@@ -578,6 +584,7 @@ model ProductionOrder {
|
|
|
578
584
|
NodeOperationQueue NodeOperationQueue[]
|
|
579
585
|
operationRegisters OperationRegister[]
|
|
580
586
|
productionNode ProductionNode[]
|
|
587
|
+
inputRegisters InputRegister[]
|
|
581
588
|
flow Flow? @relation(fields: [flowId], references: [id])
|
|
582
589
|
Product Product @relation(fields: [productId], references: [id])
|
|
583
590
|
tenant Tenant? @relation(fields: [tenantId], references: [id], onDelete: Cascade)
|
|
@@ -823,6 +830,21 @@ model MachineSensors {
|
|
|
823
830
|
@@map("machine_sensors")
|
|
824
831
|
}
|
|
825
832
|
|
|
833
|
+
model MachineProcessingScript {
|
|
834
|
+
id String @id @default(cuid())
|
|
835
|
+
machineId String @unique
|
|
836
|
+
script String
|
|
837
|
+
isActive Boolean @default(true)
|
|
838
|
+
version Int @default(1)
|
|
839
|
+
createdAt DateTime @default(now())
|
|
840
|
+
updatedAt DateTime @updatedAt
|
|
841
|
+
createdBy String?
|
|
842
|
+
|
|
843
|
+
machine Machine @relation(fields: [machineId], references: [id])
|
|
844
|
+
|
|
845
|
+
@@map("machine_processing_script")
|
|
846
|
+
}
|
|
847
|
+
|
|
826
848
|
model DeviceOperator {
|
|
827
849
|
id String @id @default(cuid())
|
|
828
850
|
deviceId String
|