efiber-prisma-schema 1.12.17 → 1.13.1

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,84 @@
1
+ name: Run Prisma Migrations
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - development
7
+ - staging
8
+ - main
9
+
10
+ jobs:
11
+ migrate-development:
12
+ if: github.ref == 'refs/heads/development'
13
+ runs-on: ubuntu-latest
14
+ environment: development
15
+ steps:
16
+ - name: Checkout
17
+ uses: actions/checkout@v4
18
+
19
+ - name: Setup SSH Key
20
+ run: |
21
+ mkdir -p ~/.ssh
22
+ echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
23
+ chmod 600 ~/.ssh/id_rsa
24
+ echo -e "Host *\n StrictHostKeyChecking no\n" > ~/.ssh/config
25
+
26
+ - name: Run Migrations on Development
27
+ run: |
28
+ ssh ${{ secrets.DEVELOPMENT_SSH_USER }}@${{ secrets.DEVELOPMENT_SSH_HOST }} "
29
+ cd efiber-prisma-schema &&
30
+ git reset --hard && git clean -fd && git pull origin development &&
31
+ export PATH=\$PATH:/home/jacob/.nvm/versions/node/v24.7.0/bin &&
32
+ npm ci && npx prisma migrate deploy --schema=./prisma/schema.prisma
33
+ "
34
+
35
+ migrate-staging:
36
+ if: github.ref == 'refs/heads/staging'
37
+ runs-on: ubuntu-latest
38
+ environment: staging
39
+ steps:
40
+ - name: Checkout
41
+ uses: actions/checkout@v4
42
+
43
+ - name: Setup SSH Key
44
+ run: |
45
+ mkdir -p ~/.ssh
46
+ echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
47
+ chmod 600 ~/.ssh/id_rsa
48
+ echo -e "Host *\n StrictHostKeyChecking no\n" > ~/.ssh/config
49
+
50
+ - name: Run Migrations on Staging (via Bastion → Prod → Staging)
51
+ run: |
52
+ ssh -J ${{ secrets.BASTION_USER }}@${{ secrets.BASTION_HOST }},${{ secrets.PRODUCTION_SSH_USER }}@${{ secrets.PRODUCTION_SSH_HOST }} \
53
+ ${{ secrets.STAGING_SSH_USER }}@${{ secrets.STAGING_SSH_HOST }} "
54
+ cd efiber-prisma-schema &&
55
+ git reset --hard && git clean -fd && git pull origin staging &&
56
+ export PATH=\$PATH:/home/ubuni/.nvm/versions/node/v24.7.0/bin && npm ci &&
57
+ npx prisma migrate deploy --schema=./prisma/schema.prisma
58
+ "
59
+
60
+ migrate-production:
61
+ if: github.ref == 'refs/heads/main'
62
+ runs-on: ubuntu-latest
63
+ environment: production
64
+ steps:
65
+ - name: Checkout
66
+ uses: actions/checkout@v4
67
+
68
+ - name: Setup SSH Key
69
+ run: |
70
+ mkdir -p ~/.ssh
71
+ echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
72
+ chmod 600 ~/.ssh/id_rsa
73
+ echo -e "Host *\n StrictHostKeyChecking no\n" > ~/.ssh/config
74
+
75
+ - name: Run Migrations on Production (via Bastion)
76
+ run: |
77
+ ssh -J ${{ secrets.BASTION_USER }}@${{ secrets.BASTION_HOST }} \
78
+ ${{ secrets.PRODUCTION_SSH_USER }}@${{ secrets.PRODUCTION_SSH_HOST }} "
79
+ cd efiber-prisma-schema &&
80
+ git reset --hard && git clean -fd && git pull origin main &&
81
+ export PATH=\$PATH:/home/ubuni/.nvm/versions/node/v24.7.0/bin && npm ci &&
82
+ npx prisma migrate deploy --schema=./prisma/schema.prisma
83
+ "
84
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efiber-prisma-schema",
3
- "version": "1.12.17",
3
+ "version": "1.13.1",
4
4
  "description": "Database schema for eFiber",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -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,2 @@
1
+ -- AlterTable
2
+ ALTER TABLE "Conduit" ADD COLUMN "coordinates" JSONB;
@@ -519,6 +519,8 @@ model User {
519
519
  CreatedRevisions Revision[] @relation("revisionCreatedBy")
520
520
  ResolvedRevisions Revision[] @relation("revisionResolvedBy")
521
521
  ClusterNotes ClusterNotes[]
522
+ Conduit Conduit[]
523
+ ConduitTemplate ConduitTemplate[]
522
524
  }
523
525
 
524
526
  model MainProject {
@@ -569,7 +571,7 @@ model Project {
569
571
 
570
572
  pboFatTemplates PboFatTemplate[]
571
573
  pboFat PboFat[]
572
- cableAttributes CableAtttributes[]
574
+ cableAttributes CableAttributes[]
573
575
  spliceClosureAttributes SpliceClosureAttributes[]
574
576
  Cable Cable[]
575
577
  CableTemplate CableTemplate[]
@@ -595,6 +597,8 @@ model Project {
595
597
  usersOnline integrationProjectUserStatus[]
596
598
  MapElementTemplate MapElementTemplate[]
597
599
  MapElement MapElement[]
600
+ ConduitTemplate ConduitTemplate? @relation(fields: [conduitTemplateId], references: [id])
601
+ conduitTemplateId String?
598
602
  }
599
603
 
600
604
  model integrationProjectUserStatus {
@@ -1039,7 +1043,7 @@ model Material {
1039
1043
  billOfMaterial MaterialBillOfMaterial[]
1040
1044
 
1041
1045
  pboFatAttributes PboFatAttributes[]
1042
- cableAttributes CableAtttributes[]
1046
+ cableAttributes CableAttributes[]
1043
1047
  spliceClosureAttributes SpliceClosureAttributes[]
1044
1048
  }
1045
1049
 
@@ -1373,6 +1377,8 @@ model NetworkElement {
1373
1377
  MapElementTemplate MapElementTemplate[]
1374
1378
  MapElement MapElement[]
1375
1379
  ElementNode ElementNode[]
1380
+ Conduit Conduit[]
1381
+ ConduitTemplate ConduitTemplate[]
1376
1382
  }
1377
1383
 
1378
1384
  model ElementNode {
@@ -1404,6 +1410,7 @@ model ElementNode {
1404
1410
  SFU SFU[]
1405
1411
  Building Building[]
1406
1412
  MapElement MapElement[]
1413
+ Conduit Conduit[]
1407
1414
  }
1408
1415
 
1409
1416
  model ElementRelation {
@@ -1511,12 +1518,14 @@ model Cable {
1511
1518
  installation NetworkElementInstallation? @relation(fields: [installationId], references: [id])
1512
1519
  installationId String?
1513
1520
 
1514
- cableAttributes CableAtttributes[]
1521
+ cableAttributes CableAttributes[]
1515
1522
  PboFatAttributes PboFatAttributes[]
1516
1523
  qrCodeTag qrCodeTag[]
1517
1524
  cluster Cluster? @relation(fields: [clusterId], references: [id])
1518
1525
  clusterId String?
1519
1526
  Revision Revision[]
1527
+ Duct Duct? @relation(fields: [ductId], references: [id])
1528
+ ductId String?
1520
1529
  }
1521
1530
 
1522
1531
  model CableTemplate {
@@ -1548,14 +1557,135 @@ model CableTemplate {
1548
1557
 
1549
1558
  projects Project[]
1550
1559
 
1551
- cableAttributes CableAtttributes[]
1560
+ cableAttributes CableAttributes[]
1552
1561
  qrCodeTemplate qrCodeTemplate[]
1553
1562
  Cable Cable[]
1554
1563
  cluster Cluster? @relation(fields: [clusterId], references: [id])
1555
1564
  clusterId String?
1556
1565
  }
1557
1566
 
1558
- model CableAtttributes {
1567
+ model Conduit {
1568
+ id String @id @unique @default(uuid())
1569
+ no Int @default(autoincrement())
1570
+
1571
+ status String @default("active")
1572
+ name String
1573
+ terminalAccess Boolean @default(false)
1574
+ photos Json? //Upload files for photos
1575
+ texts Json? //Add text attributes to the conduit
1576
+ files Json? //Upload files for the conduit
1577
+ zone Json? //Color code for zone
1578
+ geometry Json? //Icon for the conduit
1579
+ attributes Json? //Attributes for the conduit
1580
+ coordinates Json?
1581
+
1582
+ createdAt DateTime @default(now())
1583
+ updatedAt DateTime @updatedAt
1584
+ deletedAt DateTime?
1585
+
1586
+ asBuiltCoordinates Json? //As built coordinates
1587
+ isInstalled Boolean @default(false)
1588
+ installationDate DateTime?
1589
+
1590
+ isInRevision Boolean @default(false)
1591
+ installationStatus String? @default("pending") //pending, approved, in-revision
1592
+
1593
+ comments String?
1594
+
1595
+ updatedBy User? @relation(fields: [updatedById], references: [id])
1596
+ updatedById String?
1597
+
1598
+ networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
1599
+ networkElementId String
1600
+
1601
+ node ElementNode? @relation(fields: [nodeId], references: [id])
1602
+ nodeId String?
1603
+
1604
+ installation NetworkElementInstallation? @relation(fields: [installationId], references: [id])
1605
+ installationId String?
1606
+
1607
+ template ConduitTemplate? @relation(fields: [templateId], references: [id])
1608
+ templateId String?
1609
+
1610
+ cluster Cluster? @relation(fields: [clusterId], references: [id])
1611
+ clusterId String?
1612
+ qrCodeTag qrCodeTag[]
1613
+ ducts Duct[]
1614
+ }
1615
+
1616
+ model Duct {
1617
+ id String @id @unique @default(uuid())
1618
+ no Int @default(autoincrement())
1619
+
1620
+ type String
1621
+ material String
1622
+ dimension Float
1623
+ typeOptions String[]
1624
+ materialOptions String[]
1625
+
1626
+ createdAt DateTime @default(now())
1627
+ updatedAt DateTime @updatedAt
1628
+ deletedAt DateTime?
1629
+
1630
+ conduit Conduit @relation(fields: [conduitId], references: [id])
1631
+ conduitId String
1632
+
1633
+ cables Cable[]
1634
+ }
1635
+
1636
+ model ductTemplate {
1637
+ id String @id @unique @default(uuid())
1638
+ no Int @default(autoincrement())
1639
+
1640
+ type String
1641
+ material String
1642
+ dimension Float
1643
+
1644
+ typeOptions String[]
1645
+ materialOptions String[]
1646
+
1647
+ createdAt DateTime @default(now())
1648
+ updatedAt DateTime @updatedAt
1649
+ deletedAt DateTime?
1650
+
1651
+ conduit ConduitTemplate @relation(fields: [conduitTemplateId], references: [id])
1652
+ conduitTemplateId String
1653
+ }
1654
+
1655
+ model ConduitTemplate {
1656
+ id String @id @unique @default(uuid())
1657
+ no Int @default(autoincrement())
1658
+
1659
+ status String @default("active")
1660
+ name String
1661
+ terminalAccess Boolean @default(false)
1662
+ photos Json? //Upload files for photos
1663
+ texts Json? //Add text attributes to the conduit
1664
+ files Json? //Upload files for the conduit
1665
+ zone Json? //Color code for zone
1666
+ geometry Json? //Icon for the conduit
1667
+ attributes Json? //Attributes for the conduit
1668
+
1669
+ createdAt DateTime @default(now())
1670
+ updatedAt DateTime @updatedAt
1671
+ deletedAt DateTime?
1672
+
1673
+ updatedBy User? @relation(fields: [updatedById], references: [id])
1674
+ updatedById String?
1675
+
1676
+ networkElement NetworkElement @relation(fields: [networkElementId], references: [id])
1677
+ networkElementId String
1678
+
1679
+ projects Project[]
1680
+ Conduit Conduit[]
1681
+
1682
+ cluster Cluster? @relation(fields: [clusterId], references: [id])
1683
+ clusterId String?
1684
+ qrCodeTemplate qrCodeTemplate[]
1685
+ ductTemplates ductTemplate[]
1686
+ }
1687
+
1688
+ model CableAttributes {
1559
1689
  id String @id @unique @default(uuid())
1560
1690
  no Int @default(autoincrement())
1561
1691
  name String
@@ -2628,6 +2758,7 @@ model NetworkElementInstallation {
2628
2758
  FDTSRO FDTSRO[]
2629
2759
  SFU SFU[]
2630
2760
  Building Building[]
2761
+ Conduit Conduit[]
2631
2762
  }
2632
2763
 
2633
2764
  model CentralOffice {
@@ -2700,6 +2831,8 @@ model Cluster {
2700
2831
  Revision Revision[]
2701
2832
  ElementRelation ElementRelation[]
2702
2833
  ClusterNotes ClusterNotes[]
2834
+ Conduit Conduit[]
2835
+ ConduitTemplate ConduitTemplate[]
2703
2836
  }
2704
2837
 
2705
2838
  model ClusterComments {
@@ -2723,10 +2856,10 @@ model ClusterNotes {
2723
2856
  id String @id @unique @default(uuid())
2724
2857
  no Int @default(autoincrement())
2725
2858
 
2726
- comment String
2727
- hasPicture Boolean @default(false)
2859
+ comment String
2860
+ hasPicture Boolean @default(false)
2728
2861
  coordinates Json?
2729
- picture String?
2862
+ picture String?
2730
2863
 
2731
2864
  createdAt DateTime @default(now())
2732
2865
  updatedAt DateTime @updatedAt
@@ -2831,6 +2964,9 @@ model qrCodeTemplate {
2831
2964
  qrCodeTag qrCodeTag[]
2832
2965
  MapElementTemplate MapElementTemplate? @relation(fields: [mapElementTemplateId], references: [id])
2833
2966
  mapElementTemplateId String?
2967
+
2968
+ conduitTemplate ConduitTemplate? @relation(fields: [conduitTemplateId], references: [id])
2969
+ conduitTemplateId String?
2834
2970
  }
2835
2971
 
2836
2972
  model qrCodeTag {
@@ -2882,6 +3018,9 @@ model qrCodeTag {
2882
3018
  buildingId String?
2883
3019
  MapElement MapElement? @relation(fields: [mapElementId], references: [id])
2884
3020
  mapElementId String?
3021
+
3022
+ conduit Conduit? @relation(fields: [conduitId], references: [id])
3023
+ conduitId String?
2885
3024
  }
2886
3025
 
2887
3026
  model installationSequence {