efiber-prisma-schema 1.13.4 → 1.13.6

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": "efiber-prisma-schema",
3
- "version": "1.13.4",
3
+ "version": "1.13.6",
4
4
  "description": "Database schema for eFiber",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -18,8 +18,8 @@
18
18
  },
19
19
  "homepage": "https://github.com/ubuniworks-projects/efiber-prisma-schema#readme",
20
20
  "devDependencies": {
21
- "@prisma/client": "^6.8.1",
22
- "prisma": "^6.8.1"
21
+ "@prisma/client": "^6.18.0",
22
+ "prisma": "^6.18.0"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "@prisma/client": ">=5"
@@ -0,0 +1,164 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to drop the column `ductId` on the `Cable` table. All the data in the column will be lost.
5
+ - You are about to drop the column `pboFatId` on the `Cable` table. All the data in the column will be lost.
6
+ - You are about to drop the column `fdtsroMaxCapacity` on the `FDTSRO` table. All the data in the column will be lost.
7
+ - You are about to drop the column `spliceClosureMaxCapacity` on the `SpliceClosure` table. All the data in the column will be lost.
8
+
9
+ */
10
+ -- DropForeignKey
11
+ ALTER TABLE "public"."Cable" DROP CONSTRAINT "Cable_ductId_fkey";
12
+
13
+ -- DropForeignKey
14
+ ALTER TABLE "public"."Cable" DROP CONSTRAINT "Cable_pboFatId_fkey";
15
+
16
+ -- AlterTable
17
+ ALTER TABLE "Building" ADD COLUMN "buildingName" TEXT,
18
+ ADD COLUMN "managerName" TEXT,
19
+ ADD COLUMN "managerPhone" TEXT;
20
+
21
+ -- AlterTable
22
+ ALTER TABLE "Cable" DROP COLUMN "ductId",
23
+ DROP COLUMN "pboFatId";
24
+
25
+ -- AlterTable
26
+ ALTER TABLE "Conduit" ADD COLUMN "address" TEXT,
27
+ ADD COLUMN "backfillMaterial" TEXT,
28
+ ADD COLUMN "brand" TEXT,
29
+ ADD COLUMN "brandDescription" TEXT,
30
+ ADD COLUMN "conduitLength" DOUBLE PRECISION,
31
+ ADD COLUMN "enclosureDestinationId" TEXT,
32
+ ADD COLUMN "enclosureDestinationType" TEXT,
33
+ ADD COLUMN "enclosureOriginId" TEXT,
34
+ ADD COLUMN "enclosureOriginType" TEXT,
35
+ ADD COLUMN "materialListReference" TEXT,
36
+ ADD COLUMN "reinforcementMaterial" TEXT,
37
+ ADD COLUMN "specialCharacteristics" TEXT,
38
+ ADD COLUMN "trenchConfiguration" TEXT,
39
+ ADD COLUMN "trenchDepth" DOUBLE PRECISION;
40
+
41
+ -- AlterTable
42
+ ALTER TABLE "FDTSRO" DROP COLUMN "fdtsroMaxCapacity",
43
+ ADD COLUMN "address" TEXT,
44
+ ADD COLUMN "brand" TEXT,
45
+ ADD COLUMN "brandDescription" TEXT,
46
+ ADD COLUMN "materialListReference" TEXT,
47
+ ADD COLUMN "maximumCapacity" INTEGER,
48
+ ADD COLUMN "nextEquipmentId" TEXT,
49
+ ADD COLUMN "nextEquipmentType" TEXT,
50
+ ADD COLUMN "placeOfInstallation" TEXT,
51
+ ADD COLUMN "previousEquipmentId" TEXT,
52
+ ADD COLUMN "previousEquipmentType" TEXT,
53
+ ADD COLUMN "typeOfEnclosure" TEXT;
54
+
55
+ -- AlterTable
56
+ ALTER TABLE "Loop" ADD COLUMN "brand" TEXT,
57
+ ADD COLUMN "brandDescription" TEXT,
58
+ ADD COLUMN "cableId" TEXT,
59
+ ADD COLUMN "length" DOUBLE PRECISION,
60
+ ADD COLUMN "materialListReference" TEXT;
61
+
62
+ -- AlterTable
63
+ ALTER TABLE "Manhole" ADD COLUMN "address" TEXT,
64
+ ADD COLUMN "brand" TEXT,
65
+ ADD COLUMN "brandDescription" TEXT,
66
+ ADD COLUMN "coverType" TEXT,
67
+ ADD COLUMN "dimension" TEXT,
68
+ ADD COLUMN "material" TEXT,
69
+ ADD COLUMN "materialListReference" TEXT;
70
+
71
+ -- AlterTable
72
+ ALTER TABLE "Pole" ADD COLUMN "address" TEXT,
73
+ ADD COLUMN "bottomDiameter" DOUBLE PRECISION,
74
+ ADD COLUMN "brand" TEXT,
75
+ ADD COLUMN "brandDescription" TEXT,
76
+ ADD COLUMN "downGuy" BOOLEAN NOT NULL DEFAULT false,
77
+ ADD COLUMN "height" DOUBLE PRECISION,
78
+ ADD COLUMN "material" TEXT,
79
+ ADD COLUMN "materialListReference" TEXT,
80
+ ADD COLUMN "topDiameter" DOUBLE PRECISION;
81
+
82
+ -- AlterTable
83
+ ALTER TABLE "SpliceClosure" DROP COLUMN "spliceClosureMaxCapacity",
84
+ ADD COLUMN "address" TEXT,
85
+ ADD COLUMN "brand" TEXT,
86
+ ADD COLUMN "brandDescription" TEXT,
87
+ ADD COLUMN "materialListReference" TEXT,
88
+ ADD COLUMN "nextEquipmentId" TEXT,
89
+ ADD COLUMN "nextEquipmentType" TEXT,
90
+ ADD COLUMN "placeOfInstallation" TEXT,
91
+ ADD COLUMN "previousEquipmentId" TEXT,
92
+ ADD COLUMN "previousEquipmentType" TEXT,
93
+ ADD COLUMN "spliceClosureMaximumCapacity" INTEGER;
94
+
95
+ -- CreateTable
96
+ CREATE TABLE "_CableToSpliceClosure" (
97
+ "A" TEXT NOT NULL,
98
+ "B" TEXT NOT NULL,
99
+
100
+ CONSTRAINT "_CableToSpliceClosure_AB_pkey" PRIMARY KEY ("A","B")
101
+ );
102
+
103
+ -- CreateTable
104
+ CREATE TABLE "_CableToDuct" (
105
+ "A" TEXT NOT NULL,
106
+ "B" TEXT NOT NULL,
107
+
108
+ CONSTRAINT "_CableToDuct_AB_pkey" PRIMARY KEY ("A","B")
109
+ );
110
+
111
+ -- CreateTable
112
+ CREATE TABLE "_CableToPboFat" (
113
+ "A" TEXT NOT NULL,
114
+ "B" TEXT NOT NULL,
115
+
116
+ CONSTRAINT "_CableToPboFat_AB_pkey" PRIMARY KEY ("A","B")
117
+ );
118
+
119
+ -- CreateTable
120
+ CREATE TABLE "_CableToFDTSRO" (
121
+ "A" TEXT NOT NULL,
122
+ "B" TEXT NOT NULL,
123
+
124
+ CONSTRAINT "_CableToFDTSRO_AB_pkey" PRIMARY KEY ("A","B")
125
+ );
126
+
127
+ -- CreateIndex
128
+ CREATE INDEX "_CableToSpliceClosure_B_index" ON "_CableToSpliceClosure"("B");
129
+
130
+ -- CreateIndex
131
+ CREATE INDEX "_CableToDuct_B_index" ON "_CableToDuct"("B");
132
+
133
+ -- CreateIndex
134
+ CREATE INDEX "_CableToPboFat_B_index" ON "_CableToPboFat"("B");
135
+
136
+ -- CreateIndex
137
+ CREATE INDEX "_CableToFDTSRO_B_index" ON "_CableToFDTSRO"("B");
138
+
139
+ -- AddForeignKey
140
+ ALTER TABLE "Loop" ADD CONSTRAINT "Loop_cableId_fkey" FOREIGN KEY ("cableId") REFERENCES "Cable"("id") ON DELETE SET NULL ON UPDATE CASCADE;
141
+
142
+ -- AddForeignKey
143
+ ALTER TABLE "_CableToSpliceClosure" ADD CONSTRAINT "_CableToSpliceClosure_A_fkey" FOREIGN KEY ("A") REFERENCES "Cable"("id") ON DELETE CASCADE ON UPDATE CASCADE;
144
+
145
+ -- AddForeignKey
146
+ ALTER TABLE "_CableToSpliceClosure" ADD CONSTRAINT "_CableToSpliceClosure_B_fkey" FOREIGN KEY ("B") REFERENCES "SpliceClosure"("id") ON DELETE CASCADE ON UPDATE CASCADE;
147
+
148
+ -- AddForeignKey
149
+ ALTER TABLE "_CableToDuct" ADD CONSTRAINT "_CableToDuct_A_fkey" FOREIGN KEY ("A") REFERENCES "Cable"("id") ON DELETE CASCADE ON UPDATE CASCADE;
150
+
151
+ -- AddForeignKey
152
+ ALTER TABLE "_CableToDuct" ADD CONSTRAINT "_CableToDuct_B_fkey" FOREIGN KEY ("B") REFERENCES "Duct"("id") ON DELETE CASCADE ON UPDATE CASCADE;
153
+
154
+ -- AddForeignKey
155
+ ALTER TABLE "_CableToPboFat" ADD CONSTRAINT "_CableToPboFat_A_fkey" FOREIGN KEY ("A") REFERENCES "Cable"("id") ON DELETE CASCADE ON UPDATE CASCADE;
156
+
157
+ -- AddForeignKey
158
+ ALTER TABLE "_CableToPboFat" ADD CONSTRAINT "_CableToPboFat_B_fkey" FOREIGN KEY ("B") REFERENCES "PboFat"("id") ON DELETE CASCADE ON UPDATE CASCADE;
159
+
160
+ -- AddForeignKey
161
+ ALTER TABLE "_CableToFDTSRO" ADD CONSTRAINT "_CableToFDTSRO_A_fkey" FOREIGN KEY ("A") REFERENCES "Cable"("id") ON DELETE CASCADE ON UPDATE CASCADE;
162
+
163
+ -- AddForeignKey
164
+ ALTER TABLE "_CableToFDTSRO" ADD CONSTRAINT "_CableToFDTSRO_B_fkey" FOREIGN KEY ("B") REFERENCES "FDTSRO"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,24 @@
1
+ -- AlterTable
2
+ ALTER TABLE "Building" ADD COLUMN "pboFatId" TEXT;
3
+
4
+ -- AlterTable
5
+ ALTER TABLE "Conduit" ADD COLUMN "deploymentPhase" TEXT;
6
+
7
+ -- AlterTable
8
+ ALTER TABLE "FDTSRO" ADD COLUMN "splitter1" TEXT;
9
+
10
+ -- AlterTable
11
+ ALTER TABLE "SFU" ADD COLUMN "buildingId" TEXT,
12
+ ADD COLUMN "gponAddress" TEXT,
13
+ ADD COLUMN "linkToDispatch" TEXT,
14
+ ADD COLUMN "macAddress" TEXT,
15
+ ADD COLUMN "pboFatId" TEXT;
16
+
17
+ -- AddForeignKey
18
+ ALTER TABLE "SFU" ADD CONSTRAINT "SFU_pboFatId_fkey" FOREIGN KEY ("pboFatId") REFERENCES "PboFat"("id") ON DELETE SET NULL ON UPDATE CASCADE;
19
+
20
+ -- AddForeignKey
21
+ ALTER TABLE "SFU" ADD CONSTRAINT "SFU_buildingId_fkey" FOREIGN KEY ("buildingId") REFERENCES "Building"("id") ON DELETE SET NULL ON UPDATE CASCADE;
22
+
23
+ -- AddForeignKey
24
+ ALTER TABLE "Building" ADD CONSTRAINT "Building_pboFatId_fkey" FOREIGN KEY ("pboFatId") REFERENCES "PboFat"("id") ON DELETE SET NULL ON UPDATE CASCADE;
@@ -1543,15 +1543,15 @@ model Cable {
1543
1543
  cableAttachments CableAttachment[]
1544
1544
  cableAttributes CableAttributes[]
1545
1545
  PboFatAttributes PboFatAttributes[]
1546
+ spliceClosures SpliceClosure[]
1546
1547
  qrCodeTag qrCodeTag[]
1547
1548
  cluster Cluster? @relation(fields: [clusterId], references: [id])
1548
1549
  clusterId String?
1549
1550
  Revision Revision[]
1550
- Duct Duct? @relation(fields: [ductId], references: [id])
1551
- ductId String?
1552
- PboFat PboFat? @relation(fields: [pboFatId], references: [id])
1553
- pboFatId String?
1554
-
1551
+ ducts Duct[]
1552
+ PboFat PboFat[]
1553
+ Loop Loop[]
1554
+ fdtsro FDTSRO[]
1555
1555
 
1556
1556
  @@index([enclosureOriginType, enclosureOriginId])
1557
1557
  @@index([enclosureDestinationType, enclosureDestinationId])
@@ -1640,6 +1640,22 @@ model Conduit {
1640
1640
  isInRevision Boolean @default(false)
1641
1641
  installationStatus String? @default("pending") //pending, approved, in-revision
1642
1642
 
1643
+ address String? //Address of the conduit
1644
+ deploymentPhase String? //Deployment phase of the conduit
1645
+ trenchConfiguration String? //Trench configuration for the conduit
1646
+ trenchDepth Float? //Trench depth for the conduit
1647
+ backfillMaterial String? //Backfill material for the conduit
1648
+ reinforcementMaterial String? //Reinforcement material for the conduit
1649
+ specialCharacteristics String? //Special characteristics of the conduit
1650
+ enclosureOriginType String? //Type of the origin enclosure
1651
+ enclosureOriginId String? //ID of the origin enclosure
1652
+ enclosureDestinationType String? //Type of the destination enclosure
1653
+ enclosureDestinationId String? //ID of the destination enclosure
1654
+ conduitLength Float? //Length of the conduit in meters
1655
+ brand String? //Brand of the conduit
1656
+ brandDescription String? //Description of the brand
1657
+ materialListReference String? //Reference to the material list
1658
+
1643
1659
  comments String?
1644
1660
 
1645
1661
  updatedBy User? @relation(fields: [updatedById], references: [id])
@@ -1836,7 +1852,7 @@ model PboFat {
1836
1852
  installationStatus String? @default("pending") //pending, approved, in-revision
1837
1853
 
1838
1854
  // Reporting mirrors
1839
- fatMaximumCapacity Int? //Maximum capacity of the PBO FAT
1855
+ fatMaximumCapacity Int? //Maximum capacity of the PBO FAT
1840
1856
  fatExistingSubscribers Int? //Existing subscribers in the PBO FAT
1841
1857
  fatAvailableCapacity Int? //Available capacity in the PBO FAT
1842
1858
  placeOfInstallation String? //ID to an Infrastructure element
@@ -1890,6 +1906,8 @@ model PboFat {
1890
1906
 
1891
1907
  dependencies PreviousEquipment[]
1892
1908
  Revision Revision[]
1909
+ SFU SFU[]
1910
+ Building Building[]
1893
1911
 
1894
1912
  @@index([nodeId])
1895
1913
  @@index([clusterId])
@@ -1952,7 +1970,16 @@ model SpliceClosure {
1952
1970
  comments String?
1953
1971
 
1954
1972
  // Reporting mirrors
1955
- spliceClosureMaxCapacity Int? //Maximum capacity of the Splice Closure
1973
+ spliceClosureMaximumCapacity Int? //Maximum capacity of the Splice Closure
1974
+ placeOfInstallation String? //ID to an Infrastructure element
1975
+ address String? //Address of the Splice Closure
1976
+ previousEquipmentType String? //Type of the previous equipment
1977
+ previousEquipmentId String? //ID of the previous equipment
1978
+ nextEquipmentType String? //Type of the next equipment
1979
+ nextEquipmentId String? //ID of the next equipment
1980
+ brand String?
1981
+ brandDescription String?
1982
+ materialListReference String? //Reference to the material list
1956
1983
 
1957
1984
  createdAt DateTime @default(now())
1958
1985
  updatedAt DateTime @updatedAt
@@ -1983,6 +2010,7 @@ model SpliceClosure {
1983
2010
 
1984
2011
  dependencies PreviousEquipment[]
1985
2012
  Revision Revision[]
2013
+ cables Cable[]
1986
2014
  }
1987
2015
 
1988
2016
  model SpliceClosureTemplate {
@@ -2153,6 +2181,16 @@ model Pole {
2153
2181
  isInstalled Boolean @default(false)
2154
2182
  installationDate DateTime?
2155
2183
 
2184
+ address String? //Address of the pole
2185
+ material String? //Material of the pole
2186
+ height Float? //Height of the pole in meters
2187
+ topDiameter Float? //Top diameter of the pole in meters
2188
+ bottomDiameter Float? //Bottom diameter of the pole in meters
2189
+ downGuy Boolean @default(false) //Does the pole have a down guy?
2190
+ brand String? //Brand of the pole
2191
+ brandDescription String? //Description of the brand
2192
+ materialListReference String? //Reference to the material list
2193
+
2156
2194
  comments String?
2157
2195
 
2158
2196
  isInRevision Boolean @default(false)
@@ -2243,6 +2281,14 @@ model Manhole {
2243
2281
  isInstalled Boolean @default(false)
2244
2282
  installationDate DateTime?
2245
2283
 
2284
+ address String? //Address of the manhole
2285
+ material String? //Material of the manhole
2286
+ dimension String? //Dimension of the manhole
2287
+ coverType String? //Type of the cover
2288
+ brand String? //Brand of the manhole
2289
+ brandDescription String? //Description of the brand
2290
+ materialListReference String? //Reference to the material list
2291
+
2246
2292
  comments String?
2247
2293
 
2248
2294
  isInRevision Boolean @default(false)
@@ -2333,6 +2379,11 @@ model Loop {
2333
2379
  isInstalled Boolean @default(false)
2334
2380
  installationDate DateTime?
2335
2381
 
2382
+ length Float? //Length of the loop in meters
2383
+ brand String? //Brand of the loop
2384
+ brandDescription String? //Description of the brand
2385
+ materialListReference String? //Reference to the material list
2386
+
2336
2387
  comments String?
2337
2388
 
2338
2389
  isInRevision Boolean @default(false)
@@ -2363,6 +2414,9 @@ model Loop {
2363
2414
  installation NetworkElementInstallation? @relation(fields: [installationId], references: [id])
2364
2415
  installationId String?
2365
2416
 
2417
+ cable Cable? @relation(fields: [cableId], references: [id])
2418
+ cableId String?
2419
+
2366
2420
  qrCodeTag qrCodeTag[]
2367
2421
  Revision Revision[]
2368
2422
  }
@@ -2429,7 +2483,18 @@ model FDTSRO {
2429
2483
  installationStatus String? @default("pending") //pending, approved, in-revision
2430
2484
 
2431
2485
  // Reporting mirrors
2432
- fdtsroMaxCapacity Int? //Maximum capacity of the FDTSRO
2486
+ maximumCapacity Int? //Maximum capacity of the FDTSRO
2487
+ typeOfEnclosure String? //Type of the enclosure
2488
+ placeOfInstallation String? //ID to an Infrastructure element
2489
+ address String? //Address of the FDTSRO
2490
+ previousEquipmentType String? //Type of the previous equipment
2491
+ previousEquipmentId String? //ID of the previous equipment
2492
+ nextEquipmentType String? //Type of the next equipment
2493
+ nextEquipmentId String? //ID of the next equipment
2494
+ splitter1 String? //1:2, 1:4, 1:8 etc
2495
+ brand String?
2496
+ brandDescription String? //Description of the brand
2497
+ materialListReference String? //Reference to the material list
2433
2498
 
2434
2499
  createdAt DateTime @default(now())
2435
2500
  updatedAt DateTime @updatedAt
@@ -2459,6 +2524,7 @@ model FDTSRO {
2459
2524
  qrCodeTag qrCodeTag[]
2460
2525
  PreviousEquipment PreviousEquipment[]
2461
2526
  Revision Revision[]
2527
+ cables Cable[]
2462
2528
  }
2463
2529
 
2464
2530
  model FDTSROTemplate {
@@ -2517,6 +2583,10 @@ model SFU {
2517
2583
  isInstalled Boolean @default(false)
2518
2584
  installationDate DateTime?
2519
2585
 
2586
+ linkToDispatch String? //Link to the dispatch system
2587
+ macAddress String? //MAC address of the Router in the SFU
2588
+ gponAddress String? //GPON address of the SFU
2589
+
2520
2590
  isInRevision Boolean @default(false)
2521
2591
  installationStatus String? @default("pending") //pending, approved, in-revision
2522
2592
 
@@ -2547,9 +2617,14 @@ model SFU {
2547
2617
  installation NetworkElementInstallation? @relation(fields: [installationId], references: [id])
2548
2618
  installationId String?
2549
2619
 
2620
+ pboFat PboFat? @relation(fields: [pboFatId], references: [id])
2621
+ pboFatId String?
2622
+
2550
2623
  qrCodeTag qrCodeTag[]
2551
2624
  workOrders WorkOrder[]
2552
2625
  Revision Revision[]
2626
+ Building Building? @relation(fields: [buildingId], references: [id])
2627
+ buildingId String?
2553
2628
  }
2554
2629
 
2555
2630
  model SFUTemplate {
@@ -2614,9 +2689,12 @@ model Building {
2614
2689
  installationStatus String? @default("pending") //pending, approved, in-revision
2615
2690
 
2616
2691
  // Reporting mirrors
2692
+ buildingName String? //Name of the building
2617
2693
  totalFlats Int? //Total number of flats in the building
2618
2694
  floorCount Int? //Number of floors in the building
2619
2695
  flatsPerFloor Int? //Number of flats per floor
2696
+ managerName String? //Name of the building manager
2697
+ managerPhone String? //Phone number of the building manager
2620
2698
 
2621
2699
  createdAt DateTime @default(now())
2622
2700
  updatedAt DateTime @updatedAt
@@ -2643,6 +2721,10 @@ model Building {
2643
2721
  installation NetworkElementInstallation? @relation(fields: [installationId], references: [id])
2644
2722
  installationId String?
2645
2723
 
2724
+ pboFat PboFat? @relation(fields: [pboFatId], references: [id])
2725
+ pboFatId String?
2726
+
2727
+ sfu SFU[]
2646
2728
  qrCodeTag qrCodeTag[]
2647
2729
  workOrders WorkOrder[]
2648
2730
  Revision Revision[]