changing restauration to restoration.

This commit is contained in:
killian-larcher
2024-12-14 17:52:10 +01:00
parent f6852950c8
commit 4cc246514c
11 changed files with 68 additions and 38 deletions
@@ -0,0 +1,31 @@
/*
Warnings:
- You are about to drop the `restaurations` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropForeignKey
ALTER TABLE "restaurations" DROP CONSTRAINT "restaurations_backup_id_fkey";
-- DropForeignKey
ALTER TABLE "restaurations" DROP CONSTRAINT "restaurations_database_id_fkey";
-- DropTable
DROP TABLE "restaurations";
-- CreateTable
CREATE TABLE "restorations" (
"id" TEXT NOT NULL,
"status" "Status" NOT NULL DEFAULT 'waiting',
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"backup_id" TEXT NOT NULL,
"database_id" TEXT,
CONSTRAINT "restorations_pkey" PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE "restorations" ADD CONSTRAINT "restorations_backup_id_fkey" FOREIGN KEY ("backup_id") REFERENCES "backups"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "restorations" ADD CONSTRAINT "restorations_database_id_fkey" FOREIGN KEY ("database_id") REFERENCES "databases"("id") ON DELETE CASCADE ON UPDATE CASCADE;
+5 -5
View File
@@ -149,8 +149,8 @@ model Database {
agent Agent @relation(fields: [agentId], references: [id], onDelete: Cascade)
lastContact DateTime? @map("last_contact")
backups Backup[]
restaurations Restauration[]
backups Backup[]
restorations Restoration[]
projectId String? @map("project_id")
project Project? @relation(fields: [projectId], references: [id])
@@ -174,12 +174,12 @@ model Backup {
databaseId String @map("database_id")
database Database @relation(fields: [databaseId], references: [id], onDelete: Cascade)
restaurations Restauration[]
restorations Restoration[]
@@map("backups")
}
model Restauration {
model Restoration {
id String @id @default(cuid())
status Status @default(waiting)
createdAt DateTime @default(now()) @map("created_at")
@@ -190,7 +190,7 @@ model Restauration {
databaseId String? @map("database_id")
database Database? @relation(fields: [databaseId], references: [id], onDelete: Cascade)
@@map("restaurations")
@@map("restorations")
}
enum TypeStorage {