@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.
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juliobrim/prisma-shared",
3
- "version": "1.0.24",
3
+ "version": "1.0.26",
4
4
  "description": "Schema Prisma compartilhado entre projetos Sabcon",
5
5
  "main": "schema.prisma",
6
6
  "files": [
package/schema.prisma CHANGED
@@ -173,16 +173,20 @@ model Follower {
173
173
  }
174
174
 
175
175
  model InputRegister {
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
- machine Machine @relation(fields: [machineId], references: [id], onDelete: Cascade)
185
- tenant Tenant? @relation(fields: [tenantId], references: [id], onDelete: Cascade)
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 String @id @default(cuid())
235
- model String? @db.VarChar(100)
236
- name String @unique @db.VarChar(100)
237
- capacity Float? @db.Real
238
- clp_index String?
239
- acquired_date DateTime? @db.Date
240
- macAddress String? @db.VarChar(17)
241
- isDeleted Boolean @default(false)
242
- type MachineType? @default(discrete)
243
- sectorId String?
244
- tenantId String?
245
- downtime DowntimeEvent[]
246
- followers Follower[]
247
- inputRegisters InputRegister[]
248
- stationFrom ItemsHandlingRegister[] @relation("stationFrom")
249
- stationTo ItemsHandlingRegister[] @relation("stationTo")
250
- sector Sector? @relation(fields: [sectorId], references: [id])
251
- tenant Tenant? @relation(fields: [tenantId], references: [id], onDelete: Cascade)
252
- operationRegister OperationRegister[]
253
- productionNodes ProductionNode?
254
- operationResources Resource[] @relation("MachineToResource")
255
- IotMessageRegister IotMessageRegister[]
256
- MachineFormula MachineFormula[]
257
- MachineFormulaResult MachineFormulaResult[]
258
- device Device?
259
- machineSensors 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