Notification Test model and migrations

This commit is contained in:
headlesdev 2025-05-24 13:07:18 +02:00
parent 16bba5e817
commit f80ea35213
9 changed files with 1646 additions and 15 deletions

File diff suppressed because one or more lines are too long

View File

@ -219,6 +219,12 @@ exports.Prisma.NotificationProviderScalarFieldEnum = {
config: 'config'
};
exports.Prisma.NotificationTestScalarFieldEnum = {
id: 'id',
notificationProviderId: 'notificationProviderId',
success: 'success'
};
exports.Prisma.SortOrder = {
asc: 'asc',
desc: 'desc'
@ -257,7 +263,8 @@ exports.Prisma.ModelName = {
ApplicationMonitoring: 'ApplicationMonitoring',
ServerMonitoringNotification: 'ServerMonitoringNotification',
ApplicationMonitoringNotification: 'ApplicationMonitoringNotification',
NotificationProvider: 'NotificationProvider'
NotificationProvider: 'NotificationProvider',
NotificationTest: 'NotificationTest'
};
/**

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
{
"name": "prisma-client-19bcb3aaef20e52de0ea97ea43c6350ef348393f05284ca1b48815e9775e6aa7",
"name": "prisma-client-2fec847da0083065385189c4f35689219e1cfa753e77e6bee4a71c77e07624c0",
"main": "index.js",
"types": "index.d.ts",
"browser": "index-browser.js",

View File

@ -143,10 +143,20 @@ model NotificationProvider {
name String
type NotificationType
config Json
tests NotificationTest[]
@@map("notification_providers")
}
model NotificationTest {
id Int @id @default(autoincrement())
notificationProvider NotificationProvider @relation(fields: [notificationProviderId], references: [id], onDelete: Cascade)
notificationProviderId Int
success Boolean
@@map("notification_tests")
}
enum NotificationType {
TELEGRAM
}

View File

@ -219,6 +219,12 @@ exports.Prisma.NotificationProviderScalarFieldEnum = {
config: 'config'
};
exports.Prisma.NotificationTestScalarFieldEnum = {
id: 'id',
notificationProviderId: 'notificationProviderId',
success: 'success'
};
exports.Prisma.SortOrder = {
asc: 'asc',
desc: 'desc'
@ -257,7 +263,8 @@ exports.Prisma.ModelName = {
ApplicationMonitoring: 'ApplicationMonitoring',
ServerMonitoringNotification: 'ServerMonitoringNotification',
ApplicationMonitoringNotification: 'ApplicationMonitoringNotification',
NotificationProvider: 'NotificationProvider'
NotificationProvider: 'NotificationProvider',
NotificationTest: 'NotificationTest'
};
/**

View File

@ -0,0 +1,11 @@
-- CreateTable
CREATE TABLE "notification_tests" (
"id" SERIAL NOT NULL,
"notificationProviderId" INTEGER NOT NULL,
"success" BOOLEAN NOT NULL,
CONSTRAINT "notification_tests_pkey" PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE "notification_tests" ADD CONSTRAINT "notification_tests_notificationProviderId_fkey" FOREIGN KEY ("notificationProviderId") REFERENCES "notification_providers"("id") ON DELETE CASCADE ON UPDATE CASCADE;

View File

@ -145,10 +145,20 @@ model NotificationProvider {
name String
type NotificationType
config Json
tests NotificationTest[]
@@map("notification_providers")
}
model NotificationTest {
id Int @id @default(autoincrement())
notificationProvider NotificationProvider @relation(fields: [notificationProviderId], references: [id], onDelete: Cascade)
notificationProviderId Int
success Boolean
@@map("notification_tests")
}
enum NotificationType {
TELEGRAM
}