mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
Add 'enabled' field to schedule management
- Introduced a new boolean field `enabled` in the `schedule` schema to indicate the active status of schedules. - Updated the `HandleSchedules` component to include a toggle switch for enabling/disabling schedules. - Enhanced the `ShowSchedules` component to display the status of each schedule with a badge indicating whether it is enabled or disabled. - Added a new API mutation to run schedules manually, ensuring proper error handling for non-existent schedules. - Updated database schema to reflect the new `enabled` field with a default value of true.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { relations } from "drizzle-orm";
|
||||
import { pgTable, text } from "drizzle-orm/pg-core";
|
||||
import { boolean, pgTable, text } from "drizzle-orm/pg-core";
|
||||
import { createInsertSchema } from "drizzle-zod";
|
||||
import { nanoid } from "nanoid";
|
||||
import { z } from "zod";
|
||||
@@ -18,6 +18,7 @@ export const schedules = pgTable("schedule", {
|
||||
.references(() => applications.applicationId, {
|
||||
onDelete: "cascade",
|
||||
}),
|
||||
enabled: boolean("enabled").notNull().default(true),
|
||||
createdAt: text("createdAt")
|
||||
.notNull()
|
||||
.$defaultFn(() => new Date().toISOString()),
|
||||
|
||||
Reference in New Issue
Block a user