-- CreateTable
CREATE TABLE "MaintenanceWindow" (
    "id" TEXT NOT NULL PRIMARY KEY,
    "deviceId" TEXT NOT NULL,
    "userId" TEXT NOT NULL,
    "startTime" DATETIME NOT NULL,
    "endTime" DATETIME NOT NULL,
    "reason" TEXT NOT NULL DEFAULT '',
    "recurring" TEXT NOT NULL DEFAULT 'none',
    "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updatedAt" DATETIME NOT NULL
);

-- CreateIndex
CREATE INDEX "MaintenanceWindow_deviceId_idx" ON "MaintenanceWindow"("deviceId");

-- CreateIndex
CREATE INDEX "MaintenanceWindow_userId_idx" ON "MaintenanceWindow"("userId");

-- CreateIndex
CREATE INDEX "MaintenanceWindow_startTime_endTime_idx" ON "MaintenanceWindow"("startTime", "endTime");
