efiber-prisma-schema 1.13.0 → 1.13.2
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/20251010080110_create_conduit_ne/migration.sql +212 -0
- package/prisma/migrations/20251010083652_conduit_coordinates/migration.sql +2 -0
- package/prisma/migrations/20251015110151_denormalized_attributes_fat/migration.sql +79 -0
- package/prisma/schema.prisma +73 -4
package/package.json
CHANGED
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Warnings:
|
|
3
|
+
|
|
4
|
+
- You are about to drop the `CableAtttributes` table. If the table is not empty, all the data it contains will be lost.
|
|
5
|
+
|
|
6
|
+
*/
|
|
7
|
+
-- DropForeignKey
|
|
8
|
+
ALTER TABLE "CableAtttributes" DROP CONSTRAINT "CableAtttributes_cableId_fkey";
|
|
9
|
+
|
|
10
|
+
-- DropForeignKey
|
|
11
|
+
ALTER TABLE "CableAtttributes" DROP CONSTRAINT "CableAtttributes_cableTemplateId_fkey";
|
|
12
|
+
|
|
13
|
+
-- DropForeignKey
|
|
14
|
+
ALTER TABLE "CableAtttributes" DROP CONSTRAINT "CableAtttributes_materialId_fkey";
|
|
15
|
+
|
|
16
|
+
-- DropForeignKey
|
|
17
|
+
ALTER TABLE "CableAtttributes" DROP CONSTRAINT "CableAtttributes_projectId_fkey";
|
|
18
|
+
|
|
19
|
+
-- AlterTable
|
|
20
|
+
ALTER TABLE "Cable" ADD COLUMN "ductId" TEXT;
|
|
21
|
+
|
|
22
|
+
-- AlterTable
|
|
23
|
+
ALTER TABLE "Project" ADD COLUMN "conduitTemplateId" TEXT;
|
|
24
|
+
|
|
25
|
+
-- AlterTable
|
|
26
|
+
ALTER TABLE "qrCodeTag" ADD COLUMN "conduitId" TEXT;
|
|
27
|
+
|
|
28
|
+
-- AlterTable
|
|
29
|
+
ALTER TABLE "qrCodeTemplate" ADD COLUMN "conduitTemplateId" TEXT;
|
|
30
|
+
|
|
31
|
+
-- DropTable
|
|
32
|
+
DROP TABLE "CableAtttributes";
|
|
33
|
+
|
|
34
|
+
-- CreateTable
|
|
35
|
+
CREATE TABLE "Conduit" (
|
|
36
|
+
"id" TEXT NOT NULL,
|
|
37
|
+
"no" SERIAL NOT NULL,
|
|
38
|
+
"status" TEXT NOT NULL DEFAULT 'active',
|
|
39
|
+
"name" TEXT NOT NULL,
|
|
40
|
+
"terminalAccess" BOOLEAN NOT NULL DEFAULT false,
|
|
41
|
+
"photos" JSONB,
|
|
42
|
+
"texts" JSONB,
|
|
43
|
+
"files" JSONB,
|
|
44
|
+
"zone" JSONB,
|
|
45
|
+
"geometry" JSONB,
|
|
46
|
+
"attributes" JSONB,
|
|
47
|
+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
48
|
+
"updatedAt" TIMESTAMP(3) NOT NULL,
|
|
49
|
+
"deletedAt" TIMESTAMP(3),
|
|
50
|
+
"asBuiltCoordinates" JSONB,
|
|
51
|
+
"isInstalled" BOOLEAN NOT NULL DEFAULT false,
|
|
52
|
+
"installationDate" TIMESTAMP(3),
|
|
53
|
+
"isInRevision" BOOLEAN NOT NULL DEFAULT false,
|
|
54
|
+
"installationStatus" TEXT DEFAULT 'pending',
|
|
55
|
+
"comments" TEXT,
|
|
56
|
+
"updatedById" TEXT,
|
|
57
|
+
"networkElementId" TEXT NOT NULL,
|
|
58
|
+
"nodeId" TEXT,
|
|
59
|
+
"installationId" TEXT,
|
|
60
|
+
"templateId" TEXT,
|
|
61
|
+
"clusterId" TEXT,
|
|
62
|
+
|
|
63
|
+
CONSTRAINT "Conduit_pkey" PRIMARY KEY ("id")
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
-- CreateTable
|
|
67
|
+
CREATE TABLE "Duct" (
|
|
68
|
+
"id" TEXT NOT NULL,
|
|
69
|
+
"no" SERIAL NOT NULL,
|
|
70
|
+
"type" TEXT NOT NULL,
|
|
71
|
+
"material" TEXT NOT NULL,
|
|
72
|
+
"dimension" DOUBLE PRECISION NOT NULL,
|
|
73
|
+
"typeOptions" TEXT[],
|
|
74
|
+
"materialOptions" TEXT[],
|
|
75
|
+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
76
|
+
"updatedAt" TIMESTAMP(3) NOT NULL,
|
|
77
|
+
"deletedAt" TIMESTAMP(3),
|
|
78
|
+
"conduitId" TEXT NOT NULL,
|
|
79
|
+
|
|
80
|
+
CONSTRAINT "Duct_pkey" PRIMARY KEY ("id")
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
-- CreateTable
|
|
84
|
+
CREATE TABLE "ductTemplate" (
|
|
85
|
+
"id" TEXT NOT NULL,
|
|
86
|
+
"no" SERIAL NOT NULL,
|
|
87
|
+
"type" TEXT NOT NULL,
|
|
88
|
+
"material" TEXT NOT NULL,
|
|
89
|
+
"dimension" DOUBLE PRECISION NOT NULL,
|
|
90
|
+
"typeOptions" TEXT[],
|
|
91
|
+
"materialOptions" TEXT[],
|
|
92
|
+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
93
|
+
"updatedAt" TIMESTAMP(3) NOT NULL,
|
|
94
|
+
"deletedAt" TIMESTAMP(3),
|
|
95
|
+
"conduitTemplateId" TEXT NOT NULL,
|
|
96
|
+
|
|
97
|
+
CONSTRAINT "ductTemplate_pkey" PRIMARY KEY ("id")
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
-- CreateTable
|
|
101
|
+
CREATE TABLE "ConduitTemplate" (
|
|
102
|
+
"id" TEXT NOT NULL,
|
|
103
|
+
"no" SERIAL NOT NULL,
|
|
104
|
+
"status" TEXT NOT NULL DEFAULT 'active',
|
|
105
|
+
"name" TEXT NOT NULL,
|
|
106
|
+
"terminalAccess" BOOLEAN NOT NULL DEFAULT false,
|
|
107
|
+
"photos" JSONB,
|
|
108
|
+
"texts" JSONB,
|
|
109
|
+
"files" JSONB,
|
|
110
|
+
"zone" JSONB,
|
|
111
|
+
"geometry" JSONB,
|
|
112
|
+
"attributes" JSONB,
|
|
113
|
+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
114
|
+
"updatedAt" TIMESTAMP(3) NOT NULL,
|
|
115
|
+
"deletedAt" TIMESTAMP(3),
|
|
116
|
+
"updatedById" TEXT,
|
|
117
|
+
"networkElementId" TEXT NOT NULL,
|
|
118
|
+
"clusterId" TEXT,
|
|
119
|
+
|
|
120
|
+
CONSTRAINT "ConduitTemplate_pkey" PRIMARY KEY ("id")
|
|
121
|
+
);
|
|
122
|
+
|
|
123
|
+
-- CreateTable
|
|
124
|
+
CREATE TABLE "CableAttributes" (
|
|
125
|
+
"id" TEXT NOT NULL,
|
|
126
|
+
"no" SERIAL NOT NULL,
|
|
127
|
+
"name" TEXT NOT NULL,
|
|
128
|
+
"description" TEXT,
|
|
129
|
+
"value" TEXT,
|
|
130
|
+
"visibleOnMobile" BOOLEAN NOT NULL DEFAULT false,
|
|
131
|
+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
132
|
+
"updatedAt" TIMESTAMP(3) NOT NULL,
|
|
133
|
+
"deletedAt" TIMESTAMP(3),
|
|
134
|
+
"cableId" TEXT,
|
|
135
|
+
"projectId" TEXT,
|
|
136
|
+
"materialId" TEXT,
|
|
137
|
+
"cableTemplateId" TEXT,
|
|
138
|
+
|
|
139
|
+
CONSTRAINT "CableAttributes_pkey" PRIMARY KEY ("id")
|
|
140
|
+
);
|
|
141
|
+
|
|
142
|
+
-- CreateIndex
|
|
143
|
+
CREATE UNIQUE INDEX "Conduit_id_key" ON "Conduit"("id");
|
|
144
|
+
|
|
145
|
+
-- CreateIndex
|
|
146
|
+
CREATE UNIQUE INDEX "Duct_id_key" ON "Duct"("id");
|
|
147
|
+
|
|
148
|
+
-- CreateIndex
|
|
149
|
+
CREATE UNIQUE INDEX "ductTemplate_id_key" ON "ductTemplate"("id");
|
|
150
|
+
|
|
151
|
+
-- CreateIndex
|
|
152
|
+
CREATE UNIQUE INDEX "ConduitTemplate_id_key" ON "ConduitTemplate"("id");
|
|
153
|
+
|
|
154
|
+
-- CreateIndex
|
|
155
|
+
CREATE UNIQUE INDEX "CableAttributes_id_key" ON "CableAttributes"("id");
|
|
156
|
+
|
|
157
|
+
-- AddForeignKey
|
|
158
|
+
ALTER TABLE "Project" ADD CONSTRAINT "Project_conduitTemplateId_fkey" FOREIGN KEY ("conduitTemplateId") REFERENCES "ConduitTemplate"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
159
|
+
|
|
160
|
+
-- AddForeignKey
|
|
161
|
+
ALTER TABLE "Cable" ADD CONSTRAINT "Cable_ductId_fkey" FOREIGN KEY ("ductId") REFERENCES "Duct"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
162
|
+
|
|
163
|
+
-- AddForeignKey
|
|
164
|
+
ALTER TABLE "Conduit" ADD CONSTRAINT "Conduit_updatedById_fkey" FOREIGN KEY ("updatedById") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
165
|
+
|
|
166
|
+
-- AddForeignKey
|
|
167
|
+
ALTER TABLE "Conduit" ADD CONSTRAINT "Conduit_networkElementId_fkey" FOREIGN KEY ("networkElementId") REFERENCES "NetworkElement"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
|
168
|
+
|
|
169
|
+
-- AddForeignKey
|
|
170
|
+
ALTER TABLE "Conduit" ADD CONSTRAINT "Conduit_nodeId_fkey" FOREIGN KEY ("nodeId") REFERENCES "ElementNode"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
171
|
+
|
|
172
|
+
-- AddForeignKey
|
|
173
|
+
ALTER TABLE "Conduit" ADD CONSTRAINT "Conduit_installationId_fkey" FOREIGN KEY ("installationId") REFERENCES "NetworkElementInstallation"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
174
|
+
|
|
175
|
+
-- AddForeignKey
|
|
176
|
+
ALTER TABLE "Conduit" ADD CONSTRAINT "Conduit_templateId_fkey" FOREIGN KEY ("templateId") REFERENCES "ConduitTemplate"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
177
|
+
|
|
178
|
+
-- AddForeignKey
|
|
179
|
+
ALTER TABLE "Conduit" ADD CONSTRAINT "Conduit_clusterId_fkey" FOREIGN KEY ("clusterId") REFERENCES "Cluster"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
180
|
+
|
|
181
|
+
-- AddForeignKey
|
|
182
|
+
ALTER TABLE "Duct" ADD CONSTRAINT "Duct_conduitId_fkey" FOREIGN KEY ("conduitId") REFERENCES "Conduit"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
|
183
|
+
|
|
184
|
+
-- AddForeignKey
|
|
185
|
+
ALTER TABLE "ductTemplate" ADD CONSTRAINT "ductTemplate_conduitTemplateId_fkey" FOREIGN KEY ("conduitTemplateId") REFERENCES "ConduitTemplate"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
|
186
|
+
|
|
187
|
+
-- AddForeignKey
|
|
188
|
+
ALTER TABLE "ConduitTemplate" ADD CONSTRAINT "ConduitTemplate_updatedById_fkey" FOREIGN KEY ("updatedById") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
189
|
+
|
|
190
|
+
-- AddForeignKey
|
|
191
|
+
ALTER TABLE "ConduitTemplate" ADD CONSTRAINT "ConduitTemplate_networkElementId_fkey" FOREIGN KEY ("networkElementId") REFERENCES "NetworkElement"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
|
192
|
+
|
|
193
|
+
-- AddForeignKey
|
|
194
|
+
ALTER TABLE "ConduitTemplate" ADD CONSTRAINT "ConduitTemplate_clusterId_fkey" FOREIGN KEY ("clusterId") REFERENCES "Cluster"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
195
|
+
|
|
196
|
+
-- AddForeignKey
|
|
197
|
+
ALTER TABLE "CableAttributes" ADD CONSTRAINT "CableAttributes_cableId_fkey" FOREIGN KEY ("cableId") REFERENCES "Cable"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
198
|
+
|
|
199
|
+
-- AddForeignKey
|
|
200
|
+
ALTER TABLE "CableAttributes" ADD CONSTRAINT "CableAttributes_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "Project"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
201
|
+
|
|
202
|
+
-- AddForeignKey
|
|
203
|
+
ALTER TABLE "CableAttributes" ADD CONSTRAINT "CableAttributes_materialId_fkey" FOREIGN KEY ("materialId") REFERENCES "Material"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
204
|
+
|
|
205
|
+
-- AddForeignKey
|
|
206
|
+
ALTER TABLE "CableAttributes" ADD CONSTRAINT "CableAttributes_cableTemplateId_fkey" FOREIGN KEY ("cableTemplateId") REFERENCES "CableTemplate"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
207
|
+
|
|
208
|
+
-- AddForeignKey
|
|
209
|
+
ALTER TABLE "qrCodeTemplate" ADD CONSTRAINT "qrCodeTemplate_conduitTemplateId_fkey" FOREIGN KEY ("conduitTemplateId") REFERENCES "ConduitTemplate"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
210
|
+
|
|
211
|
+
-- AddForeignKey
|
|
212
|
+
ALTER TABLE "qrCodeTag" ADD CONSTRAINT "qrCodeTag_conduitId_fkey" FOREIGN KEY ("conduitId") REFERENCES "Conduit"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
-- CreateEnum
|
|
2
|
+
CREATE TYPE "CableAttachmentRole" AS ENUM ('DESTINATION', 'ORIGIN');
|
|
3
|
+
|
|
4
|
+
-- AlterTable
|
|
5
|
+
ALTER TABLE "Cable" ADD COLUMN "brand" TEXT,
|
|
6
|
+
ADD COLUMN "brandDescription" TEXT,
|
|
7
|
+
ADD COLUMN "capacity" TEXT,
|
|
8
|
+
ADD COLUMN "centralOffice" TEXT,
|
|
9
|
+
ADD COLUMN "client" TEXT,
|
|
10
|
+
ADD COLUMN "enclosureDestinationId" TEXT,
|
|
11
|
+
ADD COLUMN "enclosureDestinationType" TEXT,
|
|
12
|
+
ADD COLUMN "enclosureOriginId" TEXT,
|
|
13
|
+
ADD COLUMN "enclosureOriginType" TEXT,
|
|
14
|
+
ADD COLUMN "fibersActive" INTEGER,
|
|
15
|
+
ADD COLUMN "fibersDark" INTEGER,
|
|
16
|
+
ADD COLUMN "fibersDedicated" INTEGER,
|
|
17
|
+
ADD COLUMN "fibersReserved" INTEGER,
|
|
18
|
+
ADD COLUMN "mainProject" TEXT,
|
|
19
|
+
ADD COLUMN "pboFatId" TEXT,
|
|
20
|
+
ADD COLUMN "projectPhase" TEXT,
|
|
21
|
+
ADD COLUMN "subsidiary" TEXT,
|
|
22
|
+
ADD COLUMN "type" TEXT;
|
|
23
|
+
|
|
24
|
+
-- AlterTable
|
|
25
|
+
ALTER TABLE "PboFat" ADD COLUMN "address" TEXT,
|
|
26
|
+
ADD COLUMN "brand" TEXT,
|
|
27
|
+
ADD COLUMN "brandDescription" TEXT,
|
|
28
|
+
ADD COLUMN "centralOffice" TEXT,
|
|
29
|
+
ADD COLUMN "client" TEXT,
|
|
30
|
+
ADD COLUMN "mainProject" TEXT,
|
|
31
|
+
ADD COLUMN "materialListReference" TEXT,
|
|
32
|
+
ADD COLUMN "nextEquipmentId" TEXT,
|
|
33
|
+
ADD COLUMN "nextEquipmentType" TEXT,
|
|
34
|
+
ADD COLUMN "placeOfInstallation" TEXT,
|
|
35
|
+
ADD COLUMN "previousEquipmentId" TEXT,
|
|
36
|
+
ADD COLUMN "previousEquipmentType" TEXT,
|
|
37
|
+
ADD COLUMN "projectPhase" TEXT,
|
|
38
|
+
ADD COLUMN "splitter1" TEXT,
|
|
39
|
+
ADD COLUMN "splitter2" TEXT,
|
|
40
|
+
ADD COLUMN "subsidiary" TEXT;
|
|
41
|
+
|
|
42
|
+
-- CreateTable
|
|
43
|
+
CREATE TABLE "CableAttachment" (
|
|
44
|
+
"id" TEXT NOT NULL,
|
|
45
|
+
"no" SERIAL NOT NULL,
|
|
46
|
+
"cableId" TEXT NOT NULL,
|
|
47
|
+
"targetType" TEXT NOT NULL,
|
|
48
|
+
"targetId" TEXT NOT NULL,
|
|
49
|
+
"role" "CableAttachmentRole" NOT NULL,
|
|
50
|
+
"metadata" JSONB,
|
|
51
|
+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
52
|
+
"updatedAt" TIMESTAMP(3) NOT NULL,
|
|
53
|
+
|
|
54
|
+
CONSTRAINT "CableAttachment_pkey" PRIMARY KEY ("id")
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
-- CreateIndex
|
|
58
|
+
CREATE UNIQUE INDEX "CableAttachment_id_key" ON "CableAttachment"("id");
|
|
59
|
+
|
|
60
|
+
-- CreateIndex
|
|
61
|
+
CREATE INDEX "CableAttachment_targetType_targetId_idx" ON "CableAttachment"("targetType", "targetId");
|
|
62
|
+
|
|
63
|
+
-- CreateIndex
|
|
64
|
+
CREATE INDEX "CableAttachment_cableId_role_idx" ON "CableAttachment"("cableId", "role");
|
|
65
|
+
|
|
66
|
+
-- CreateIndex
|
|
67
|
+
CREATE UNIQUE INDEX "CableAttachment_cableId_targetType_targetId_role_key" ON "CableAttachment"("cableId", "targetType", "targetId", "role");
|
|
68
|
+
|
|
69
|
+
-- CreateIndex
|
|
70
|
+
CREATE INDEX "Cable_enclosureOriginType_enclosureOriginId_idx" ON "Cable"("enclosureOriginType", "enclosureOriginId");
|
|
71
|
+
|
|
72
|
+
-- CreateIndex
|
|
73
|
+
CREATE INDEX "Cable_enclosureDestinationType_enclosureDestinationId_idx" ON "Cable"("enclosureDestinationType", "enclosureDestinationId");
|
|
74
|
+
|
|
75
|
+
-- AddForeignKey
|
|
76
|
+
ALTER TABLE "Cable" ADD CONSTRAINT "Cable_pboFatId_fkey" FOREIGN KEY ("pboFatId") REFERENCES "PboFat"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
77
|
+
|
|
78
|
+
-- AddForeignKey
|
|
79
|
+
ALTER TABLE "CableAttachment" ADD CONSTRAINT "CableAttachment_cableId_fkey" FOREIGN KEY ("cableId") REFERENCES "Cable"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
package/prisma/schema.prisma
CHANGED
|
@@ -127,6 +127,11 @@ enum AttributeType {
|
|
|
127
127
|
JSON
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
+
enum CableAttachmentRole {
|
|
131
|
+
DESTINATION
|
|
132
|
+
ORIGIN
|
|
133
|
+
}
|
|
134
|
+
|
|
130
135
|
model Country {
|
|
131
136
|
id String @id @unique @default(uuid())
|
|
132
137
|
no Int @default(autoincrement())
|
|
@@ -1493,8 +1498,25 @@ model Cable {
|
|
|
1493
1498
|
comments String?
|
|
1494
1499
|
|
|
1495
1500
|
// Reporting mirrors
|
|
1496
|
-
|
|
1497
|
-
|
|
1501
|
+
enclosureOriginType String? //Type of the origin enclosure
|
|
1502
|
+
enclosureOriginId String? //ID of the origin enclosure
|
|
1503
|
+
enclosureDestinationType String? //Type of the destination enclosure
|
|
1504
|
+
enclosureDestinationId String? //ID of the destination enclosure
|
|
1505
|
+
cableLength Float? //Length of the cable in meters
|
|
1506
|
+
actualCableLength Float? //Actual length of the cable in meters
|
|
1507
|
+
type String? //Type of cable (e.g., aerial, underground)
|
|
1508
|
+
capacity String? //Capacity of cable(12FO, 24FO, 48FO)
|
|
1509
|
+
fibersActive Int? //Number of active fibers
|
|
1510
|
+
fibersReserved Int? //Number of reserved fibers
|
|
1511
|
+
fibersDark Int? //Number of dark fibers
|
|
1512
|
+
fibersDedicated Int? //Number of dedicated fibers
|
|
1513
|
+
brand String? //Brand of the cable
|
|
1514
|
+
brandDescription String? //Description of the brand
|
|
1515
|
+
centralOffice String? //Central office associated with the cable
|
|
1516
|
+
mainProject String? //Main project associated with the cable
|
|
1517
|
+
projectPhase String? //Project phase (e.g., planning, execution)
|
|
1518
|
+
client String? //Client associated with the cable
|
|
1519
|
+
subsidiary String? //Subsidiary or branch
|
|
1498
1520
|
|
|
1499
1521
|
createdAt DateTime @default(now())
|
|
1500
1522
|
updatedAt DateTime @updatedAt
|
|
@@ -1518,6 +1540,7 @@ model Cable {
|
|
|
1518
1540
|
installation NetworkElementInstallation? @relation(fields: [installationId], references: [id])
|
|
1519
1541
|
installationId String?
|
|
1520
1542
|
|
|
1543
|
+
cableAttachments CableAttachment[]
|
|
1521
1544
|
cableAttributes CableAttributes[]
|
|
1522
1545
|
PboFatAttributes PboFatAttributes[]
|
|
1523
1546
|
qrCodeTag qrCodeTag[]
|
|
@@ -1526,6 +1549,33 @@ model Cable {
|
|
|
1526
1549
|
Revision Revision[]
|
|
1527
1550
|
Duct Duct? @relation(fields: [ductId], references: [id])
|
|
1528
1551
|
ductId String?
|
|
1552
|
+
PboFat PboFat? @relation(fields: [pboFatId], references: [id])
|
|
1553
|
+
pboFatId String?
|
|
1554
|
+
|
|
1555
|
+
|
|
1556
|
+
@@index([enclosureOriginType, enclosureOriginId])
|
|
1557
|
+
@@index([enclosureDestinationType, enclosureDestinationId])
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
model CableAttachment {
|
|
1561
|
+
id String @id @unique @default(uuid())
|
|
1562
|
+
no Int @default(autoincrement())
|
|
1563
|
+
|
|
1564
|
+
cable Cable @relation(fields: [cableId], references: [id])
|
|
1565
|
+
cableId String
|
|
1566
|
+
|
|
1567
|
+
targetType String
|
|
1568
|
+
targetId String
|
|
1569
|
+
|
|
1570
|
+
role CableAttachmentRole
|
|
1571
|
+
metadata Json?
|
|
1572
|
+
|
|
1573
|
+
createdAt DateTime @default(now())
|
|
1574
|
+
updatedAt DateTime @updatedAt
|
|
1575
|
+
|
|
1576
|
+
@@unique([cableId, targetType, targetId, role])
|
|
1577
|
+
@@index([targetType, targetId])
|
|
1578
|
+
@@index([cableId, role])
|
|
1529
1579
|
}
|
|
1530
1580
|
|
|
1531
1581
|
model CableTemplate {
|
|
@@ -1560,7 +1610,7 @@ model CableTemplate {
|
|
|
1560
1610
|
cableAttributes CableAttributes[]
|
|
1561
1611
|
qrCodeTemplate qrCodeTemplate[]
|
|
1562
1612
|
Cable Cable[]
|
|
1563
|
-
cluster Cluster?
|
|
1613
|
+
cluster Cluster? @relation(fields: [clusterId], references: [id])
|
|
1564
1614
|
clusterId String?
|
|
1565
1615
|
}
|
|
1566
1616
|
|
|
@@ -1577,6 +1627,7 @@ model Conduit {
|
|
|
1577
1627
|
zone Json? //Color code for zone
|
|
1578
1628
|
geometry Json? //Icon for the conduit
|
|
1579
1629
|
attributes Json? //Attributes for the conduit
|
|
1630
|
+
coordinates Json?
|
|
1580
1631
|
|
|
1581
1632
|
createdAt DateTime @default(now())
|
|
1582
1633
|
updatedAt DateTime @updatedAt
|
|
@@ -1681,7 +1732,7 @@ model ConduitTemplate {
|
|
|
1681
1732
|
cluster Cluster? @relation(fields: [clusterId], references: [id])
|
|
1682
1733
|
clusterId String?
|
|
1683
1734
|
qrCodeTemplate qrCodeTemplate[]
|
|
1684
|
-
ductTemplates
|
|
1735
|
+
ductTemplates ductTemplate[]
|
|
1685
1736
|
}
|
|
1686
1737
|
|
|
1687
1738
|
model CableAttributes {
|
|
@@ -1788,6 +1839,17 @@ model PboFat {
|
|
|
1788
1839
|
fatMaxCapacity Int? //Maximum capacity of the PBO FAT
|
|
1789
1840
|
fatExistingSubscribers Int? //Existing subscribers in the PBO FAT
|
|
1790
1841
|
fatAvailableCapacity Int? //Available capacity in the PBO FAT
|
|
1842
|
+
placeOfInstallation String? //ID to an Infrastructure element
|
|
1843
|
+
address String? //Address of the PBO FAT
|
|
1844
|
+
splitter1 String? //1:2, 1:4, 1:8 etc
|
|
1845
|
+
splitter2 String?
|
|
1846
|
+
previousEquipmentType String? //Type of the previous equipment
|
|
1847
|
+
previousEquipmentId String? //ID of the previous equipment
|
|
1848
|
+
nextEquipmentType String? //Type of the next equipment
|
|
1849
|
+
nextEquipmentId String? //ID of the next equipment
|
|
1850
|
+
brand String?
|
|
1851
|
+
brandDescription String?
|
|
1852
|
+
materialListReference String? //Reference to the material list
|
|
1791
1853
|
|
|
1792
1854
|
createdAt DateTime @default(now())
|
|
1793
1855
|
updatedAt DateTime @updatedAt
|
|
@@ -1815,6 +1877,13 @@ model PboFat {
|
|
|
1815
1877
|
qrCodeTag qrCodeTag[]
|
|
1816
1878
|
cluster Cluster? @relation(fields: [clusterId], references: [id])
|
|
1817
1879
|
clusterId String?
|
|
1880
|
+
// cluster relationship but static fields for centraloffice,project, main project etc
|
|
1881
|
+
centralOffice String?
|
|
1882
|
+
projectPhase String?
|
|
1883
|
+
mainProject String?
|
|
1884
|
+
client String?
|
|
1885
|
+
subsidiary String?
|
|
1886
|
+
cables Cable[]
|
|
1818
1887
|
|
|
1819
1888
|
node ElementNode? @relation(fields: [nodeId], references: [id])
|
|
1820
1889
|
nodeId String?
|