efiber-prisma-schema 1.10.7 → 1.10.8

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.10.7",
3
+ "version": "1.10.8",
4
4
  "description": "Database schema for eFiber",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,32 @@
1
+ -- AlterEnum
2
+ ALTER TYPE "EquipmentType" ADD VALUE 'FDTSRO';
3
+
4
+ -- AlterTable
5
+ ALTER TABLE "Building" ADD COLUMN "coordinates" JSONB;
6
+
7
+ -- AlterTable
8
+ ALTER TABLE "FDTSRO" ADD COLUMN "coordinates" JSONB;
9
+
10
+ -- AlterTable
11
+ ALTER TABLE "Loop" ADD COLUMN "coordinates" JSONB;
12
+
13
+ -- AlterTable
14
+ ALTER TABLE "Manhole" ADD COLUMN "coordinates" JSONB;
15
+
16
+ -- AlterTable
17
+ ALTER TABLE "PboFat" ADD COLUMN "coordinates" JSONB;
18
+
19
+ -- AlterTable
20
+ ALTER TABLE "Pole" ADD COLUMN "coordinates" JSONB;
21
+
22
+ -- AlterTable
23
+ ALTER TABLE "PreviousEquipment" ADD COLUMN "fdtsroId" TEXT;
24
+
25
+ -- AlterTable
26
+ ALTER TABLE "SFU" ADD COLUMN "coordinates" JSONB;
27
+
28
+ -- AlterTable
29
+ ALTER TABLE "SpliceClosure" ADD COLUMN "coordinates" JSONB;
30
+
31
+ -- AddForeignKey
32
+ ALTER TABLE "PreviousEquipment" ADD CONSTRAINT "PreviousEquipment_fdtsroId_fkey" FOREIGN KEY ("fdtsroId") REFERENCES "FDTSRO"("id") ON DELETE SET NULL ON UPDATE CASCADE;
@@ -0,0 +1,23 @@
1
+ -- CreateTable
2
+ CREATE TABLE "integrationUserLocation" (
3
+ "id" TEXT NOT NULL,
4
+ "no" SERIAL NOT NULL,
5
+ "userId" TEXT NOT NULL,
6
+ "coordinates" JSONB NOT NULL,
7
+ "clusterId" TEXT,
8
+ "isActive" BOOLEAN NOT NULL DEFAULT true,
9
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
10
+ "updatedAt" TIMESTAMP(3) NOT NULL,
11
+ "deletedAt" TIMESTAMP(3),
12
+
13
+ CONSTRAINT "integrationUserLocation_pkey" PRIMARY KEY ("id")
14
+ );
15
+
16
+ -- CreateIndex
17
+ CREATE UNIQUE INDEX "integrationUserLocation_id_key" ON "integrationUserLocation"("id");
18
+
19
+ -- AddForeignKey
20
+ ALTER TABLE "integrationUserLocation" ADD CONSTRAINT "integrationUserLocation_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
21
+
22
+ -- AddForeignKey
23
+ ALTER TABLE "integrationUserLocation" ADD CONSTRAINT "integrationUserLocation_clusterId_fkey" FOREIGN KEY ("clusterId") REFERENCES "Cluster"("id") ON DELETE SET NULL ON UPDATE CASCADE;
@@ -405,6 +405,7 @@ model User {
405
405
  SFUTemplate SFUTemplate[]
406
406
  BuildingTemplate BuildingTemplate[]
407
407
  integrationProjectUserStatus integrationProjectUserStatus[]
408
+ integrationUserLocation integrationUserLocation[]
408
409
  }
409
410
 
410
411
  model MainProject {
@@ -2134,29 +2135,30 @@ model Cluster {
2134
2135
  centralOffice CentralOffice? @relation(fields: [centralOfficeId], references: [id])
2135
2136
  centralOfficeId String?
2136
2137
 
2137
- users User[]
2138
- ZoneNro ZoneNro[]
2139
- Pole Pole[]
2140
- Manhole Manhole[]
2141
- Loop Loop[]
2142
- FDTSRO FDTSRO[]
2143
- SFU SFU[]
2144
- Building Building[]
2145
- Cable Cable[]
2146
- PboFat PboFat[]
2147
- SpliceClosure SpliceClosure[]
2148
- CableTemplate CableTemplate[]
2149
- PboFatTemplate PboFatTemplate[]
2150
- SpliceClosureTemplate SpliceClosureTemplate[]
2151
- ZoneNroTemplate ZoneNroTemplate[]
2152
- PoleTemplate PoleTemplate[]
2153
- ManholeTemplate ManholeTemplate[]
2154
- LoopTemplate LoopTemplate[]
2155
- FDTSROTemplate FDTSROTemplate[]
2156
- SFUTemplate SFUTemplate[]
2157
- BuildingTemplate BuildingTemplate[]
2158
- usersOnline integrationProjectUserStatus[]
2159
- qrCodeTemplate qrCodeTemplate[]
2138
+ users User[]
2139
+ ZoneNro ZoneNro[]
2140
+ Pole Pole[]
2141
+ Manhole Manhole[]
2142
+ Loop Loop[]
2143
+ FDTSRO FDTSRO[]
2144
+ SFU SFU[]
2145
+ Building Building[]
2146
+ Cable Cable[]
2147
+ PboFat PboFat[]
2148
+ SpliceClosure SpliceClosure[]
2149
+ CableTemplate CableTemplate[]
2150
+ PboFatTemplate PboFatTemplate[]
2151
+ SpliceClosureTemplate SpliceClosureTemplate[]
2152
+ ZoneNroTemplate ZoneNroTemplate[]
2153
+ PoleTemplate PoleTemplate[]
2154
+ ManholeTemplate ManholeTemplate[]
2155
+ LoopTemplate LoopTemplate[]
2156
+ FDTSROTemplate FDTSROTemplate[]
2157
+ SFUTemplate SFUTemplate[]
2158
+ BuildingTemplate BuildingTemplate[]
2159
+ usersOnline integrationProjectUserStatus[]
2160
+ qrCodeTemplate qrCodeTemplate[]
2161
+ integrationUserLocation integrationUserLocation[]
2160
2162
  }
2161
2163
 
2162
2164
  model qrCodeTemplate {
@@ -2303,3 +2305,22 @@ model PreviousEquipment {
2303
2305
 
2304
2306
  @@unique([fromTable, fromId, toTable, toId])
2305
2307
  }
2308
+
2309
+ model integrationUserLocation {
2310
+ id String @id @unique @default(uuid())
2311
+ no Int @default(autoincrement())
2312
+
2313
+ User User @relation(fields: [userId], references: [id])
2314
+ userId String
2315
+
2316
+ coordinates Json
2317
+
2318
+ cluster Cluster? @relation(fields: [clusterId], references: [id])
2319
+ clusterId String?
2320
+
2321
+ isActive Boolean @default(true)
2322
+
2323
+ createdAt DateTime @default(now())
2324
+ updatedAt DateTime @updatedAt
2325
+ deletedAt DateTime?
2326
+ }