Update Prisma

This commit is contained in:
Douglas Barone 2022-08-30 07:33:05 -04:00
parent c9307e4273
commit 549324851a
3 changed files with 4866 additions and 5769 deletions

10312
server/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,7 @@
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/douglasvbarone/ifms-gql-server.git" "url": "git+https://github.com/douglasvbarone/ifms-portal-de-ti.git"
}, },
"keywords": [ "keywords": [
"ifms" "ifms"
@ -27,9 +27,9 @@
"author": "Douglas Barone", "author": "Douglas Barone",
"license": "ISC", "license": "ISC",
"bugs": { "bugs": {
"url": "https://github.com/douglasvbarone/ifms-gql-server/issues" "url": "https://github.com/douglasvbarone/ifms-portal-de-ti/issues"
}, },
"homepage": "https://github.com/douglasvbarone/ifms-gql-server#readme", "homepage": "https://github.com/douglasvbarone/ifms-portal-de-ti#readme",
"devDependencies": { "devDependencies": {
"@babel/cli": "^7.16.0", "@babel/cli": "^7.16.0",
"@babel/core": "^7.16.0", "@babel/core": "^7.16.0",
@ -37,10 +37,10 @@
"@babel/plugin-proposal-object-rest-spread": "^7.16.0", "@babel/plugin-proposal-object-rest-spread": "^7.16.0",
"@babel/preset-env": "^7.16.0", "@babel/preset-env": "^7.16.0",
"nodemon": "^2.0.15", "nodemon": "^2.0.15",
"prisma": "^3.15.2" "prisma": "^4.2.1"
}, },
"dependencies": { "dependencies": {
"@prisma/client": "^3.15.2", "@prisma/client": "^4.2.1",
"activedirectory2": "^2.1.0", "activedirectory2": "^2.1.0",
"apollo-server": "^2.19.0", "apollo-server": "^2.19.0",
"apollo-server-plugin-response-cache": "^0.5.6", "apollo-server-plugin-response-cache": "^0.5.6",

View File

@ -14,12 +14,10 @@ model ResetToken {
usedAt DateTime? usedAt DateTime?
createdAt DateTime @default(now()) createdAt DateTime @default(now())
updatedAt DateTime @updatedAt updatedAt DateTime @updatedAt
userId Int userId Int
user User @relation("resettoken_to_user", fields: [userId], references: [id])
creatorId Int creatorId Int
creator User @relation("resettoken_to_creator", fields: [creatorId], references: [id]) creator User @relation("resettoken_to_creator", fields: [creatorId], references: [id])
user User @relation("resettoken_to_user", fields: [userId], references: [id])
} }
model User { model User {
@ -68,13 +66,11 @@ model User {
userPrincipalName String? userPrincipalName String?
whenChanged String? whenChanged String?
whenCreated String? whenCreated String?
PAHost PAHost[] @relation("pahost_to_user")
createdTokens ResetToken[] @relation("resettoken_to_creator") createdTokens ResetToken[] @relation("resettoken_to_creator")
tokens ResetToken[] @relation("resettoken_to_user") tokens ResetToken[] @relation("resettoken_to_user")
wifiDevices WifiDevice[] @relation("wifidevice_to_user")
ownedWifiDevices WifiDevice[] @relation("wifidevice_to_owner") ownedWifiDevices WifiDevice[] @relation("wifidevice_to_owner")
wifiDevices WifiDevice[] @relation("wifidevice_to_user")
PAHost PAHost[] @relation("pahost_to_user")
} }
model WifiDevice { model WifiDevice {
@ -84,40 +80,28 @@ model WifiDevice {
hostname String? hostname String?
firstSeen DateTime? @default(now()) firstSeen DateTime? @default(now())
lastSeen DateTime? lastSeen DateTime?
ip String?
name String?
notes String?
essid String? essid String?
uptime Int? ip String?
apName String? apName String?
signalStrength Int?
frequency String?
protocol String?
speed Int?
usage BigInt?
status Status? status Status?
createdAt DateTime @default(now()) createdAt DateTime @default(now())
updatedAt DateTime @updatedAt updatedAt DateTime @updatedAt
userId Int?
controller String @default("unknown") controller String @default("unknown")
identity String? // The user informed by the controller
accessPointId Int? accessPointId Int?
accessPoint AccessPoint? @relation("wifidevice_to_ap", fields: [accessPointId], references: [id], onDelete: SetNull) frequency String?
identity String?
userId Int? // The connected User name String?
user User? @relation("wifidevice_to_user", fields: [userId], references: [id]) notes String?
ownerId Int?
ownerId Int? // The owner of the device protocol String?
signalStrength Int?
speed Int?
usage BigInt?
uptime Int?
accessPoint AccessPoint? @relation("wifidevice_to_ap", fields: [accessPointId], references: [id])
owner User? @relation("wifidevice_to_owner", fields: [ownerId], references: [id]) owner User? @relation("wifidevice_to_owner", fields: [ownerId], references: [id])
} user User? @relation("wifidevice_to_user", fields: [userId], references: [id])
enum Status {
ONLINE
RECENT
OFFLINE
} }
model Log { model Log {
@ -129,14 +113,6 @@ model Log {
data Json? data Json?
} }
enum LogLevel {
LOW
INFO
SUCCESS
WARNING
ERROR
}
model PAHost { model PAHost {
id Int @id @default(autoincrement()) id Int @id @default(autoincrement())
user String user String
@ -146,7 +122,6 @@ model PAHost {
note String? note String?
createdAt DateTime @default(now()) createdAt DateTime @default(now())
updatedAt DateTime @updatedAt updatedAt DateTime @updatedAt
ownerId Int ownerId Int
owner User @relation("pahost_to_user", fields: [ownerId], references: [id]) owner User @relation("pahost_to_user", fields: [ownerId], references: [id])
} }
@ -158,46 +133,35 @@ model AccessPoint {
name String? name String?
local String? local String?
notes String? notes String?
inventoryTag String?
uptime Int?
controller String? controller String?
model String? model String?
ip String? ip String?
clients Int? clients Int?
usage BigInt?
encryptedSshUser String?
encryptedSshPassword String?
createdAt DateTime @default(now()) createdAt DateTime @default(now())
updatedAt DateTime @updatedAt updatedAt DateTime @updatedAt
encryptedSshPassword String?
wifiDevices WifiDevice[] @relation("wifidevice_to_ap") encryptedSshUser String?
inventoryTag String?
usage BigInt?
uptime Int?
stats AccessPointStats[] @relation("accesspointstats_to_ap") stats AccessPointStats[] @relation("accesspointstats_to_ap")
wifiDevices WifiDevice[] @relation("wifidevice_to_ap")
} }
model AccessPointStats { model AccessPointStats {
id Int @id @default(autoincrement()) id Int @id @default(autoincrement())
timestamp DateTime @default(now()) timestamp DateTime @default(now())
clients Int? clients Int?
avgSignalStrength Int? avgSignalStrength Int?
minSignalStrength Int? minSignalStrength Int?
maxSignalStrength Int? maxSignalStrength Int?
avgSpeed Int? avgSpeed Int?
minSpeed Int? minSpeed Int?
maxSpeed Int? maxSpeed Int?
avgClientUptime Int? avgClientUptime Int?
maxClientUptime Int? maxClientUptime Int?
avgUsage BigInt? avgUsage BigInt?
sumUsage BigInt? sumUsage BigInt?
accessPointId Int accessPointId Int
accessPoint AccessPoint @relation("accesspointstats_to_ap", fields: [accessPointId], references: [id], onDelete: Cascade) accessPoint AccessPoint @relation("accesspointstats_to_ap", fields: [accessPointId], references: [id], onDelete: Cascade)
} }
@ -207,7 +171,20 @@ model Network {
name String @unique name String @unique
shortName String @unique shortName String @unique
cidr String @unique cidr String @unique
createdAt DateTime @default(now()) createdAt DateTime @default(now())
updatedAt DateTime @updatedAt updatedAt DateTime @updatedAt
} }
enum Status {
ONLINE
RECENT
OFFLINE
}
enum LogLevel {
LOW
INFO
SUCCESS
WARNING
ERROR
}