Files
sofa/drizzle/20260304175614_melted_anthem/migration.sql
T
jake b17f54f6db Add cronRuns table and integrate job scheduling with database logging
- Created a new `cronRuns` table to track job execution history, including job name, status, timestamps, and error messages.
- Updated job scheduling logic to log job status in the `cronRuns` table, capturing success and error states.
- Enhanced error handling to log detailed error messages in the database.

This commit establishes a foundation for monitoring scheduled jobs and their outcomes.
2026-03-04 12:59:19 -05:00

10 lines
284 B
SQL

CREATE TABLE `cronRuns` (
`id` text PRIMARY KEY,
`jobName` text NOT NULL,
`status` text NOT NULL,
`startedAt` integer NOT NULL,
`finishedAt` integer,
`errorMessage` text
);
--> statement-breakpoint
CREATE INDEX `cronRuns_jobName_startedAt` ON `cronRuns` (`jobName`,`startedAt`);