efiber-prisma-schema 1.11.4 → 1.11.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.11.4",
3
+ "version": "1.11.6",
4
4
  "description": "Database schema for eFiber",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,12 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to drop the column `metricId` on the `ReportVisualization` table. All the data in the column will be lost.
5
+
6
+ */
7
+ -- DropForeignKey
8
+ ALTER TABLE "ReportVisualization" DROP CONSTRAINT "ReportVisualization_metricId_fkey";
9
+
10
+ -- AlterTable
11
+ ALTER TABLE "ReportVisualization" DROP COLUMN "metricId",
12
+ ADD COLUMN "metricIds" TEXT[];
@@ -0,0 +1,5 @@
1
+ -- CreateEnum
2
+ CREATE TYPE "MetricType" AS ENUM ('ProjectInfo', 'NetworkElement', 'NetworkElementAttributes', 'FormulaResult');
3
+
4
+ -- AlterTable
5
+ ALTER TABLE "ReportMetric" ADD COLUMN "metricType" "MetricType";
@@ -65,6 +65,13 @@ enum ChartType {
65
65
  PIE
66
66
  }
67
67
 
68
+ enum MetricType {
69
+ ProjectInfo
70
+ NetworkElement
71
+ NetworkElementAttributes
72
+ FormulaResult
73
+ }
74
+
68
75
  model Country {
69
76
  id String @id @unique @default(uuid())
70
77
  no Int @default(autoincrement())
@@ -2435,6 +2442,8 @@ model ReportMetric {
2435
2442
  elementType NetworkElementChildType?
2436
2443
  attributeName String //Name of the attribute to be reported
2437
2444
 
2445
+ metricType MetricType?
2446
+
2438
2447
  // Aggregation across records
2439
2448
  formula AggregationOperation?
2440
2449
  groupByLevel ProjectLevel?
@@ -2445,7 +2454,6 @@ model ReportMetric {
2445
2454
  // Usage Classification
2446
2455
  usage ReportUsage[] @default([TABLE])
2447
2456
 
2448
- visualizations ReportVisualization[]
2449
2457
  ReportTable ReportTable[]
2450
2458
  }
2451
2459
 
@@ -2466,8 +2474,7 @@ model ReportVisualization {
2466
2474
  template IntegrationReportTemplate @relation(fields: [templateId], references: [id])
2467
2475
  templateId String
2468
2476
 
2469
- metric ReportMetric @relation(fields: [metricId], references: [id])
2470
- metricId String
2477
+ metricIds String[] //List of ReportMetric IDs to be visualized
2471
2478
 
2472
2479
  chartType ChartType
2473
2480
  xAxisField String? //e.g "Client Name"