Skip to content

feat: add database scheduled jobs - #5680

Open
nktnet1 wants to merge 2 commits into
Dokploy:canaryfrom
nktnet1:database-schedule
Open

nktnet1 wants to merge 2 commits into
Dokploy:canaryfrom
nktnet1:database-schedule

Conversation

@nktnet1

@nktnet1 nktnet1 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

What is this PR about?

Add scheduled jobs for databases

Checklist

Before submitting this PR, please make sure that:

  • You created a dedicated branch based on the canary branch.
  • You have read the suggestions in the CONTRIBUTING.md file https://github.com/Dokploy/dokploy/blob/canary/CONTRIBUTING.md#pull-request
  • You have tested this PR in your local instance. If you have not tested it yet, please do so before submitting. This helps avoid wasting maintainers' time reviewing code that has not been verified by you.

Issues related (if applicable)

closes #5388

RetriggerView in GreptileConfidence Score: 5/5

The reviewed changes appear safe to merge; no new actionable issue was found.

Summary

Adds scheduled commands for PostgreSQL, MySQL, MariaDB, MongoDB, Redis, and LibSQL.

  • Database service pages let operators create and manage scheduled commands.
  • Scheduled commands run in database containers and keep their run logs.
  • Deleting a database or project also clears its scheduled jobs.

Both earlier, unnumbered findings are addressed in the current code. No new actionable issue was found in the changes since the last review. Runtime tests were not run.

Reviews (2) · Last reviewed commit: "fix: verify cloud scheduler cancellation..." · Reviewed by Greptile

@nktnet1
nktnet1 marked this pull request as ready for review October 15, 2026 08:43
@nktnet1
nktnet1 requested a review from Siumauricio as a code owner October 15, 2026 08:43
Comment thread packages/server/src/services/schedule.ts Outdated
Comment thread packages/server/src/db/schema/schedule.ts
@imrja8

imrja8 commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

@greptileai reivew..

@nktnet1

nktnet1 commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

I don't think the typecheck errors were caused by this PR.

@imrja8

imrja8 commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

I don't think the typecheck errors were caused by this PR.

CI typecheck is failing on two errors from this PR:

1. permissions is not declared in the libsql page

apps/dokploy/pages/dashboard/project/[projectId]/environment/[environmentId]/services/libsql/[libsqlId].tsx (lines 208, 212, 215, 228, 317)

The page uses permissions?.schedule.read but never declares permissions, so it would also crash at runtime with ReferenceError: permissions is not defined. Add the same query the other DB pages use:

const { data: permissions } = api.user.getPermissions.useQuery();

2. createScheduleSchema input not assignable to Partial<Schedule>

apps/dokploy/server/api/routers/schedule.ts (lines 42, 58)

The zod-inferred input isn't assignable to Partial<Schedule> when passed to isValidDatabaseScheduleTarget / getDatabaseScheduleId. The existing createSchedule / updateSchedule already cast this same zod type before handing it to drizzle.

Please type both helpers to accept only the fields they read (scheduleType, the DB id columns, applicationId, composeId, serverId, organizationId), or cast at the call site like the existing code.

Please run pnpm typecheck locally before pushing.

@nktnet1

nktnet1 commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

@imrja8 main branch merged + typechecked.

@imrja8

imrja8 commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

@imrja8 main branch merged + typechecked.

Will be reviewing it

@imrja8

imrja8 commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

@nktnet1 Hi, this PR now has merge conflicts with canary. Could you resolve them? I'll continue the review after.

@nktnet1

nktnet1 commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

@imrja8 rebased.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support scheduled jobs for databases

2 participants