From 7da6501ca7b237713c4699efe4908bb2c3ee1ec7 Mon Sep 17 00:00:00 2001 From: headlessdev Date: Mon, 14 Apr 2025 22:16:22 +0200 Subject: [PATCH] Uptime History DB Model --- .../20250414201604_uptime_history/migration.sql | 9 +++++++++ prisma/schema.prisma | 7 +++++++ 2 files changed, 16 insertions(+) create mode 100644 prisma/migrations/20250414201604_uptime_history/migration.sql diff --git a/prisma/migrations/20250414201604_uptime_history/migration.sql b/prisma/migrations/20250414201604_uptime_history/migration.sql new file mode 100644 index 0000000..3021ba4 --- /dev/null +++ b/prisma/migrations/20250414201604_uptime_history/migration.sql @@ -0,0 +1,9 @@ +-- CreateTable +CREATE TABLE "uptime_history" ( + "id" SERIAL NOT NULL, + "applicationId" INTEGER NOT NULL DEFAULT 1, + "online" BOOLEAN NOT NULL DEFAULT true, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "uptime_history_pkey" PRIMARY KEY ("id") +); diff --git a/prisma/schema.prisma b/prisma/schema.prisma index e96f1bd..55fe57d 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -25,6 +25,13 @@ model application { online Boolean @default(true) } +model uptime_history { + id Int @id @default(autoincrement()) + applicationId Int @default(1) + online Boolean @default(true) + createdAt DateTime @default(now()) +} + model server { id Int @id @default(autoincrement()) name String