efiber-prisma-schema 1.10.7 → 1.10.9
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.
|
|
3
|
+
"version": "1.10.9",
|
|
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.
|
|
22
|
-
"prisma": "^6.
|
|
21
|
+
"@prisma/client": "^6.5.0",
|
|
22
|
+
"prisma": "^6.5.0"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@prisma/client": ">=5"
|
|
@@ -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;
|
package/prisma/schema.prisma
CHANGED
|
@@ -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 {
|
|
@@ -1672,7 +1673,7 @@ model Pole {
|
|
|
1672
1673
|
installation NetworkElementInstallation? @relation(fields: [installationId], references: [id])
|
|
1673
1674
|
installationId String?
|
|
1674
1675
|
|
|
1675
|
-
qrCodeTag
|
|
1676
|
+
qrCodeTag qrCodeTag[]
|
|
1676
1677
|
}
|
|
1677
1678
|
|
|
1678
1679
|
model PoleTemplate {
|
|
@@ -2104,7 +2105,7 @@ model NetworkElementInstallation {
|
|
|
2104
2105
|
model CentralOffice {
|
|
2105
2106
|
id String @id @unique @default(uuid())
|
|
2106
2107
|
no Int @default(autoincrement())
|
|
2107
|
-
name String
|
|
2108
|
+
name String
|
|
2108
2109
|
|
|
2109
2110
|
createdAt DateTime @default(now())
|
|
2110
2111
|
updatedAt DateTime @updatedAt
|
|
@@ -2120,7 +2121,7 @@ model CentralOffice {
|
|
|
2120
2121
|
model Cluster {
|
|
2121
2122
|
id String @id @unique @default(uuid())
|
|
2122
2123
|
no Int @default(autoincrement())
|
|
2123
|
-
name String
|
|
2124
|
+
name String
|
|
2124
2125
|
coordinates Json?
|
|
2125
2126
|
color String?
|
|
2126
2127
|
|
|
@@ -2134,36 +2135,37 @@ model Cluster {
|
|
|
2134
2135
|
centralOffice CentralOffice? @relation(fields: [centralOfficeId], references: [id])
|
|
2135
2136
|
centralOfficeId String?
|
|
2136
2137
|
|
|
2137
|
-
users
|
|
2138
|
-
ZoneNro
|
|
2139
|
-
Pole
|
|
2140
|
-
Manhole
|
|
2141
|
-
Loop
|
|
2142
|
-
FDTSRO
|
|
2143
|
-
SFU
|
|
2144
|
-
Building
|
|
2145
|
-
Cable
|
|
2146
|
-
PboFat
|
|
2147
|
-
SpliceClosure
|
|
2148
|
-
CableTemplate
|
|
2149
|
-
PboFatTemplate
|
|
2150
|
-
SpliceClosureTemplate
|
|
2151
|
-
ZoneNroTemplate
|
|
2152
|
-
PoleTemplate
|
|
2153
|
-
ManholeTemplate
|
|
2154
|
-
LoopTemplate
|
|
2155
|
-
FDTSROTemplate
|
|
2156
|
-
SFUTemplate
|
|
2157
|
-
BuildingTemplate
|
|
2158
|
-
usersOnline
|
|
2159
|
-
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 {
|
|
2163
2165
|
id String @id @unique @default(uuid())
|
|
2164
2166
|
no Int @default(autoincrement())
|
|
2165
2167
|
name String
|
|
2166
|
-
prefix String
|
|
2168
|
+
prefix String
|
|
2167
2169
|
index Int //number of qr code generated
|
|
2168
2170
|
scanned Int @default(0)
|
|
2169
2171
|
link String? @unique //where the qr code will redirect to
|
|
@@ -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
|
+
}
|