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' config: 'config'
}; };
exports.Prisma.NotificationTestScalarFieldEnum = {
id: 'id',
notificationProviderId: 'notificationProviderId',
success: 'success'
};
exports.Prisma.SortOrder = { exports.Prisma.SortOrder = {
asc: 'asc', asc: 'asc',
desc: 'desc' desc: 'desc'
@ -257,7 +263,8 @@ exports.Prisma.ModelName = {
ApplicationMonitoring: 'ApplicationMonitoring', ApplicationMonitoring: 'ApplicationMonitoring',
ServerMonitoringNotification: 'ServerMonitoringNotification', ServerMonitoringNotification: 'ServerMonitoringNotification',
ApplicationMonitoringNotification: 'ApplicationMonitoringNotification', 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", "main": "index.js",
"types": "index.d.ts", "types": "index.d.ts",
"browser": "index-browser.js", "browser": "index-browser.js",

View File

@ -139,14 +139,24 @@ model ApplicationMonitoringNotification {
} }
model NotificationProvider { model NotificationProvider {
id Int @id @default(autoincrement()) id Int @id @default(autoincrement())
name String name String
type NotificationType type NotificationType
config Json config Json
tests NotificationTest[]
@@map("notification_providers") @@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 { enum NotificationType {
TELEGRAM TELEGRAM
} }

View File

@ -219,6 +219,12 @@ exports.Prisma.NotificationProviderScalarFieldEnum = {
config: 'config' config: 'config'
}; };
exports.Prisma.NotificationTestScalarFieldEnum = {
id: 'id',
notificationProviderId: 'notificationProviderId',
success: 'success'
};
exports.Prisma.SortOrder = { exports.Prisma.SortOrder = {
asc: 'asc', asc: 'asc',
desc: 'desc' desc: 'desc'
@ -257,7 +263,8 @@ exports.Prisma.ModelName = {
ApplicationMonitoring: 'ApplicationMonitoring', ApplicationMonitoring: 'ApplicationMonitoring',
ServerMonitoringNotification: 'ServerMonitoringNotification', ServerMonitoringNotification: 'ServerMonitoringNotification',
ApplicationMonitoringNotification: 'ApplicationMonitoringNotification', 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 name String
type NotificationType type NotificationType
config Json config Json
tests NotificationTest[]
@@map("notification_providers") @@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 { enum NotificationType {
TELEGRAM TELEGRAM
} }