Update schedule management with shell type support and version upgrades

- Updated the `drizzle-zod` package to version 0.7.1 across the project for enhanced schema validation.
- Introduced a new `shellType` column in the `schedule` schema to specify the shell used for executing commands, defaulting to 'bash'.
- Enhanced the `HandleSchedules` component to include the new `shellType` field, allowing users to select the shell type when creating or updating schedules.
- Updated the `runCommand` utility to utilize the selected shell type when executing commands, improving flexibility in command execution.
- Refactored the API to accommodate the new `shellType` in schedule creation and updates, ensuring proper handling of the new field.
This commit is contained in:
Mauricio Siu
2025-05-02 15:56:40 -06:00
parent f2bb01c800
commit 2c90103823
11 changed files with 5766 additions and 239 deletions
+4 -2
View File
@@ -3,6 +3,7 @@ import { z } from "zod";
import {
createScheduleSchema,
schedules,
updateScheduleSchema,
} from "@dokploy/server/db/schema/schedule";
import { desc, eq } from "drizzle-orm";
import { createTRPCRouter, protectedProcedure } from "../trpc";
@@ -13,15 +14,16 @@ export const scheduleRouter = createTRPCRouter({
create: protectedProcedure
.input(createScheduleSchema)
.mutation(async ({ ctx, input }) => {
const { scheduleId, ...rest } = input;
const [schedule] = await ctx.db
.insert(schedules)
.values(input)
.values(rest)
.returning();
return schedule;
}),
update: protectedProcedure
.input(createScheduleSchema.extend({ scheduleId: z.string() }))
.input(updateScheduleSchema)
.mutation(async ({ ctx, input }) => {
const { scheduleId, ...rest } = input;
const [schedule] = await ctx.db