mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-17 15:36:50 +00:00
Virtual Machines Database Schema
This commit is contained in:
parent
e3795977f7
commit
7f98261f7b
File diff suppressed because one or more lines are too long
@ -163,6 +163,23 @@ exports.Prisma.ServerScalarFieldEnum = {
|
|||||||
monitoringUrl: 'monitoringUrl'
|
monitoringUrl: 'monitoringUrl'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exports.Prisma.VirtualMachineScalarFieldEnum = {
|
||||||
|
id: 'id',
|
||||||
|
name: 'name',
|
||||||
|
description: 'description',
|
||||||
|
serverId: 'serverId',
|
||||||
|
icon: 'icon',
|
||||||
|
ipv4Address: 'ipv4Address',
|
||||||
|
osDetails: 'osDetails',
|
||||||
|
cpuDetails: 'cpuDetails',
|
||||||
|
gpuDetails: 'gpuDetails',
|
||||||
|
memoryDetails: 'memoryDetails',
|
||||||
|
storageDetails: 'storageDetails',
|
||||||
|
managementUrl: 'managementUrl',
|
||||||
|
monitoring: 'monitoring',
|
||||||
|
monitoringUrl: 'monitoringUrl'
|
||||||
|
};
|
||||||
|
|
||||||
exports.Prisma.ServerMonitoringScalarFieldEnum = {
|
exports.Prisma.ServerMonitoringScalarFieldEnum = {
|
||||||
id: 'id',
|
id: 'id',
|
||||||
serverId: 'serverId',
|
serverId: 'serverId',
|
||||||
@ -178,6 +195,20 @@ exports.Prisma.ServerMonitoringScalarFieldEnum = {
|
|||||||
timestamp: 'timestamp'
|
timestamp: 'timestamp'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exports.Prisma.VirtualMachineMonitoringScalarFieldEnum = {
|
||||||
|
id: 'id',
|
||||||
|
virtualMachineId: 'virtualMachineId',
|
||||||
|
cpuPercentUsage: 'cpuPercentUsage',
|
||||||
|
gpuPercentUsage: 'gpuPercentUsage',
|
||||||
|
memoryUsage: 'memoryUsage',
|
||||||
|
memoryPercentUsage: 'memoryPercentUsage',
|
||||||
|
diskUsage: 'diskUsage',
|
||||||
|
diskPercentUsage: 'diskPercentUsage',
|
||||||
|
online: 'online',
|
||||||
|
uptimeSeconds: 'uptimeSeconds',
|
||||||
|
timestamp: 'timestamp'
|
||||||
|
};
|
||||||
|
|
||||||
exports.Prisma.ApplicationScalarFieldEnum = {
|
exports.Prisma.ApplicationScalarFieldEnum = {
|
||||||
id: 'id',
|
id: 'id',
|
||||||
serverId: 'serverId',
|
serverId: 'serverId',
|
||||||
@ -257,6 +288,7 @@ exports.Prisma.GeneralApplicationMonitoringSettingsScalarFieldEnum = {
|
|||||||
exports.Prisma.ServerMonitoringSettingsScalarFieldEnum = {
|
exports.Prisma.ServerMonitoringSettingsScalarFieldEnum = {
|
||||||
id: 'id',
|
id: 'id',
|
||||||
serverId: 'serverId',
|
serverId: 'serverId',
|
||||||
|
virtualMachineId: 'virtualMachineId',
|
||||||
generalSettingsId: 'generalSettingsId'
|
generalSettingsId: 'generalSettingsId'
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -301,7 +333,9 @@ exports.Prisma.ModelName = {
|
|||||||
Site: 'Site',
|
Site: 'Site',
|
||||||
Network: 'Network',
|
Network: 'Network',
|
||||||
Server: 'Server',
|
Server: 'Server',
|
||||||
|
VirtualMachine: 'VirtualMachine',
|
||||||
ServerMonitoring: 'ServerMonitoring',
|
ServerMonitoring: 'ServerMonitoring',
|
||||||
|
VirtualMachineMonitoring: 'VirtualMachineMonitoring',
|
||||||
Application: 'Application',
|
Application: 'Application',
|
||||||
ApplicationMonitoring: 'ApplicationMonitoring',
|
ApplicationMonitoring: 'ApplicationMonitoring',
|
||||||
ServerMonitoringNotification: 'ServerMonitoringNotification',
|
ServerMonitoringNotification: 'ServerMonitoringNotification',
|
||||||
|
|||||||
4189
prisma/generated/prisma/index.d.ts
vendored
4189
prisma/generated/prisma/index.d.ts
vendored
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "prisma-client-d1e43606f7a3013467af671b0e6bb25d802256e22d857bc4d3e40d92038c4fbf",
|
"name": "prisma-client-e3080283d00fbb54f90aec0a7cb9f0267d5a3f3765e8526acffa91eb02bd7194",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"types": "index.d.ts",
|
"types": "index.d.ts",
|
||||||
"browser": "index-browser.js",
|
"browser": "index-browser.js",
|
||||||
|
|||||||
@ -69,10 +69,33 @@ model Server {
|
|||||||
monitoringData ServerMonitoring[]
|
monitoringData ServerMonitoring[]
|
||||||
applications Application[]
|
applications Application[]
|
||||||
monitoringSettings ServerMonitoringSettings[]
|
monitoringSettings ServerMonitoringSettings[]
|
||||||
|
virtualMachines VirtualMachine[]
|
||||||
|
|
||||||
@@map("servers")
|
@@map("servers")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
model VirtualMachine {
|
||||||
|
id Int @id @default(autoincrement())
|
||||||
|
name String
|
||||||
|
description String?
|
||||||
|
server Server @relation(fields: [serverId], references: [id], onDelete: Cascade)
|
||||||
|
serverId Int
|
||||||
|
icon String?
|
||||||
|
ipv4Address String?
|
||||||
|
osDetails String?
|
||||||
|
cpuDetails String?
|
||||||
|
gpuDetails String?
|
||||||
|
memoryDetails String?
|
||||||
|
storageDetails String?
|
||||||
|
managementUrl String?
|
||||||
|
monitoring Boolean @default(false)
|
||||||
|
monitoringUrl String?
|
||||||
|
monitoringSettings ServerMonitoringSettings[]
|
||||||
|
monitoringData VirtualMachineMonitoring[]
|
||||||
|
|
||||||
|
@@map("virtual_machines")
|
||||||
|
}
|
||||||
|
|
||||||
model ServerMonitoring {
|
model ServerMonitoring {
|
||||||
id Int @id @default(autoincrement())
|
id Int @id @default(autoincrement())
|
||||||
server Server @relation(fields: [serverId], references: [id], onDelete: Cascade)
|
server Server @relation(fields: [serverId], references: [id], onDelete: Cascade)
|
||||||
@ -93,6 +116,25 @@ model ServerMonitoring {
|
|||||||
@@map("server_monitoring")
|
@@map("server_monitoring")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
model VirtualMachineMonitoring {
|
||||||
|
id Int @id @default(autoincrement())
|
||||||
|
virtualMachine VirtualMachine @relation(fields: [virtualMachineId], references: [id], onDelete: Cascade)
|
||||||
|
virtualMachineId Int
|
||||||
|
cpuPercentUsage Float
|
||||||
|
gpuPercentUsage Float
|
||||||
|
memoryUsage Float
|
||||||
|
memoryPercentUsage Float
|
||||||
|
diskUsage Float
|
||||||
|
diskPercentUsage Float
|
||||||
|
online Boolean
|
||||||
|
uptimeSeconds Int
|
||||||
|
timestamp DateTime @default(now())
|
||||||
|
|
||||||
|
@@index([virtualMachineId, timestamp])
|
||||||
|
@@index([online])
|
||||||
|
@@map("virtual_machine_monitoring")
|
||||||
|
}
|
||||||
|
|
||||||
model Application {
|
model Application {
|
||||||
id Int @id @default(autoincrement())
|
id Int @id @default(autoincrement())
|
||||||
server Server @relation(fields: [serverId], references: [id], onDelete: Cascade)
|
server Server @relation(fields: [serverId], references: [id], onDelete: Cascade)
|
||||||
@ -205,6 +247,8 @@ model ServerMonitoringSettings {
|
|||||||
id Int @id @default(autoincrement())
|
id Int @id @default(autoincrement())
|
||||||
server Server @relation(fields: [serverId], references: [id], onDelete: Cascade)
|
server Server @relation(fields: [serverId], references: [id], onDelete: Cascade)
|
||||||
serverId Int
|
serverId Int
|
||||||
|
virtualMachine VirtualMachine @relation(fields: [virtualMachineId], references: [id], onDelete: Cascade)
|
||||||
|
virtualMachineId Int
|
||||||
generalSettings GeneralServerMonitoringSettings @relation(fields: [generalSettingsId], references: [id], onDelete: Cascade)
|
generalSettings GeneralServerMonitoringSettings @relation(fields: [generalSettingsId], references: [id], onDelete: Cascade)
|
||||||
generalSettingsId Int
|
generalSettingsId Int
|
||||||
}
|
}
|
||||||
|
|||||||
@ -163,6 +163,23 @@ exports.Prisma.ServerScalarFieldEnum = {
|
|||||||
monitoringUrl: 'monitoringUrl'
|
monitoringUrl: 'monitoringUrl'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exports.Prisma.VirtualMachineScalarFieldEnum = {
|
||||||
|
id: 'id',
|
||||||
|
name: 'name',
|
||||||
|
description: 'description',
|
||||||
|
serverId: 'serverId',
|
||||||
|
icon: 'icon',
|
||||||
|
ipv4Address: 'ipv4Address',
|
||||||
|
osDetails: 'osDetails',
|
||||||
|
cpuDetails: 'cpuDetails',
|
||||||
|
gpuDetails: 'gpuDetails',
|
||||||
|
memoryDetails: 'memoryDetails',
|
||||||
|
storageDetails: 'storageDetails',
|
||||||
|
managementUrl: 'managementUrl',
|
||||||
|
monitoring: 'monitoring',
|
||||||
|
monitoringUrl: 'monitoringUrl'
|
||||||
|
};
|
||||||
|
|
||||||
exports.Prisma.ServerMonitoringScalarFieldEnum = {
|
exports.Prisma.ServerMonitoringScalarFieldEnum = {
|
||||||
id: 'id',
|
id: 'id',
|
||||||
serverId: 'serverId',
|
serverId: 'serverId',
|
||||||
@ -178,6 +195,20 @@ exports.Prisma.ServerMonitoringScalarFieldEnum = {
|
|||||||
timestamp: 'timestamp'
|
timestamp: 'timestamp'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exports.Prisma.VirtualMachineMonitoringScalarFieldEnum = {
|
||||||
|
id: 'id',
|
||||||
|
virtualMachineId: 'virtualMachineId',
|
||||||
|
cpuPercentUsage: 'cpuPercentUsage',
|
||||||
|
gpuPercentUsage: 'gpuPercentUsage',
|
||||||
|
memoryUsage: 'memoryUsage',
|
||||||
|
memoryPercentUsage: 'memoryPercentUsage',
|
||||||
|
diskUsage: 'diskUsage',
|
||||||
|
diskPercentUsage: 'diskPercentUsage',
|
||||||
|
online: 'online',
|
||||||
|
uptimeSeconds: 'uptimeSeconds',
|
||||||
|
timestamp: 'timestamp'
|
||||||
|
};
|
||||||
|
|
||||||
exports.Prisma.ApplicationScalarFieldEnum = {
|
exports.Prisma.ApplicationScalarFieldEnum = {
|
||||||
id: 'id',
|
id: 'id',
|
||||||
serverId: 'serverId',
|
serverId: 'serverId',
|
||||||
@ -257,6 +288,7 @@ exports.Prisma.GeneralApplicationMonitoringSettingsScalarFieldEnum = {
|
|||||||
exports.Prisma.ServerMonitoringSettingsScalarFieldEnum = {
|
exports.Prisma.ServerMonitoringSettingsScalarFieldEnum = {
|
||||||
id: 'id',
|
id: 'id',
|
||||||
serverId: 'serverId',
|
serverId: 'serverId',
|
||||||
|
virtualMachineId: 'virtualMachineId',
|
||||||
generalSettingsId: 'generalSettingsId'
|
generalSettingsId: 'generalSettingsId'
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -301,7 +333,9 @@ exports.Prisma.ModelName = {
|
|||||||
Site: 'Site',
|
Site: 'Site',
|
||||||
Network: 'Network',
|
Network: 'Network',
|
||||||
Server: 'Server',
|
Server: 'Server',
|
||||||
|
VirtualMachine: 'VirtualMachine',
|
||||||
ServerMonitoring: 'ServerMonitoring',
|
ServerMonitoring: 'ServerMonitoring',
|
||||||
|
VirtualMachineMonitoring: 'VirtualMachineMonitoring',
|
||||||
Application: 'Application',
|
Application: 'Application',
|
||||||
ApplicationMonitoring: 'ApplicationMonitoring',
|
ApplicationMonitoring: 'ApplicationMonitoring',
|
||||||
ServerMonitoringNotification: 'ServerMonitoringNotification',
|
ServerMonitoringNotification: 'ServerMonitoringNotification',
|
||||||
|
|||||||
@ -0,0 +1,60 @@
|
|||||||
|
/*
|
||||||
|
Warnings:
|
||||||
|
|
||||||
|
- Added the required column `virtualMachineId` to the `ServerMonitoringSettings` table without a default value. This is not possible if the table is not empty.
|
||||||
|
|
||||||
|
*/
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "ServerMonitoringSettings" ADD COLUMN "virtualMachineId" INTEGER NOT NULL;
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "virtual_machines" (
|
||||||
|
"id" SERIAL NOT NULL,
|
||||||
|
"name" TEXT NOT NULL,
|
||||||
|
"description" TEXT,
|
||||||
|
"serverId" INTEGER NOT NULL,
|
||||||
|
"icon" TEXT,
|
||||||
|
"ipv4Address" TEXT,
|
||||||
|
"osDetails" TEXT,
|
||||||
|
"cpuDetails" TEXT,
|
||||||
|
"gpuDetails" TEXT,
|
||||||
|
"memoryDetails" TEXT,
|
||||||
|
"storageDetails" TEXT,
|
||||||
|
"managementUrl" TEXT,
|
||||||
|
"monitoring" BOOLEAN NOT NULL DEFAULT false,
|
||||||
|
"monitoringUrl" TEXT,
|
||||||
|
|
||||||
|
CONSTRAINT "virtual_machines_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "virtual_machine_monitoring" (
|
||||||
|
"id" SERIAL NOT NULL,
|
||||||
|
"virtualMachineId" INTEGER NOT NULL,
|
||||||
|
"cpuPercentUsage" DOUBLE PRECISION NOT NULL,
|
||||||
|
"gpuPercentUsage" DOUBLE PRECISION NOT NULL,
|
||||||
|
"memoryUsage" DOUBLE PRECISION NOT NULL,
|
||||||
|
"memoryPercentUsage" DOUBLE PRECISION NOT NULL,
|
||||||
|
"diskUsage" DOUBLE PRECISION NOT NULL,
|
||||||
|
"diskPercentUsage" DOUBLE PRECISION NOT NULL,
|
||||||
|
"online" BOOLEAN NOT NULL,
|
||||||
|
"uptimeSeconds" INTEGER NOT NULL,
|
||||||
|
"timestamp" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
|
||||||
|
CONSTRAINT "virtual_machine_monitoring_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE INDEX "virtual_machine_monitoring_virtualMachineId_timestamp_idx" ON "virtual_machine_monitoring"("virtualMachineId", "timestamp");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE INDEX "virtual_machine_monitoring_online_idx" ON "virtual_machine_monitoring"("online");
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "virtual_machines" ADD CONSTRAINT "virtual_machines_serverId_fkey" FOREIGN KEY ("serverId") REFERENCES "servers"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "virtual_machine_monitoring" ADD CONSTRAINT "virtual_machine_monitoring_virtualMachineId_fkey" FOREIGN KEY ("virtualMachineId") REFERENCES "virtual_machines"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "ServerMonitoringSettings" ADD CONSTRAINT "ServerMonitoringSettings_virtualMachineId_fkey" FOREIGN KEY ("virtualMachineId") REFERENCES "virtual_machines"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
@ -69,10 +69,33 @@ model Server {
|
|||||||
monitoringData ServerMonitoring[]
|
monitoringData ServerMonitoring[]
|
||||||
applications Application[]
|
applications Application[]
|
||||||
monitoringSettings ServerMonitoringSettings[]
|
monitoringSettings ServerMonitoringSettings[]
|
||||||
|
virtualMachines VirtualMachine[]
|
||||||
|
|
||||||
@@map("servers")
|
@@map("servers")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
model VirtualMachine {
|
||||||
|
id Int @id @default(autoincrement())
|
||||||
|
name String
|
||||||
|
description String?
|
||||||
|
server Server @relation(fields: [serverId], references: [id], onDelete: Cascade)
|
||||||
|
serverId Int
|
||||||
|
icon String?
|
||||||
|
ipv4Address String?
|
||||||
|
osDetails String?
|
||||||
|
cpuDetails String?
|
||||||
|
gpuDetails String?
|
||||||
|
memoryDetails String?
|
||||||
|
storageDetails String?
|
||||||
|
managementUrl String?
|
||||||
|
monitoring Boolean @default(false)
|
||||||
|
monitoringUrl String?
|
||||||
|
monitoringSettings ServerMonitoringSettings[]
|
||||||
|
monitoringData VirtualMachineMonitoring[]
|
||||||
|
|
||||||
|
@@map("virtual_machines")
|
||||||
|
}
|
||||||
|
|
||||||
model ServerMonitoring {
|
model ServerMonitoring {
|
||||||
id Int @id @default(autoincrement())
|
id Int @id @default(autoincrement())
|
||||||
server Server @relation(fields: [serverId], references: [id], onDelete: Cascade)
|
server Server @relation(fields: [serverId], references: [id], onDelete: Cascade)
|
||||||
@ -94,6 +117,27 @@ model ServerMonitoring {
|
|||||||
@@map("server_monitoring")
|
@@map("server_monitoring")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
model VirtualMachineMonitoring {
|
||||||
|
id Int @id @default(autoincrement())
|
||||||
|
virtualMachine VirtualMachine @relation(fields: [virtualMachineId], references: [id], onDelete: Cascade)
|
||||||
|
virtualMachineId Int
|
||||||
|
cpuPercentUsage Float
|
||||||
|
gpuPercentUsage Float
|
||||||
|
memoryUsage Float
|
||||||
|
memoryPercentUsage Float
|
||||||
|
diskUsage Float
|
||||||
|
diskPercentUsage Float
|
||||||
|
online Boolean
|
||||||
|
uptimeSeconds Int
|
||||||
|
timestamp DateTime @default(now())
|
||||||
|
|
||||||
|
@@index([virtualMachineId, timestamp])
|
||||||
|
@@index([online])
|
||||||
|
|
||||||
|
@@map("virtual_machine_monitoring")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
model Application {
|
model Application {
|
||||||
id Int @id @default(autoincrement())
|
id Int @id @default(autoincrement())
|
||||||
server Server @relation(fields: [serverId], references: [id], onDelete: Cascade)
|
server Server @relation(fields: [serverId], references: [id], onDelete: Cascade)
|
||||||
@ -207,6 +251,8 @@ model ServerMonitoringSettings {
|
|||||||
id Int @id @default(autoincrement())
|
id Int @id @default(autoincrement())
|
||||||
server Server @relation(fields: [serverId], references: [id], onDelete: Cascade)
|
server Server @relation(fields: [serverId], references: [id], onDelete: Cascade)
|
||||||
serverId Int
|
serverId Int
|
||||||
|
virtualMachine VirtualMachine @relation(fields: [virtualMachineId], references: [id], onDelete: Cascade)
|
||||||
|
virtualMachineId Int
|
||||||
generalSettings GeneralServerMonitoringSettings @relation(fields: [generalSettingsId], references: [id], onDelete: Cascade)
|
generalSettings GeneralServerMonitoringSettings @relation(fields: [generalSettingsId], references: [id], onDelete: Cascade)
|
||||||
generalSettingsId Int
|
generalSettingsId Int
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user