Files
ScheduleTaskManager/server/drizzle/0000_aspiring_blink.sql
T
2026-07-09 22:51:03 +02:00

29 lines
927 B
SQL

CREATE TABLE `scheduled_tasks` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`server_id` integer NOT NULL,
`schedule_type` text NOT NULL,
`name` text NOT NULL,
`command` text,
`schedule_expression` text,
`source` text,
`enabled` integer DEFAULT true NOT NULL,
`next_run_at` text,
`raw_metadata` text,
`is_stale` integer DEFAULT false NOT NULL,
`first_seen_at` text DEFAULT (current_timestamp) NOT NULL,
`last_seen_at` text DEFAULT (current_timestamp) NOT NULL,
FOREIGN KEY (`server_id`) REFERENCES `servers`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE TABLE `servers` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`name` text NOT NULL,
`hostname` text,
`os_type` text DEFAULT 'linux' NOT NULL,
`description` text,
`api_token_hash` text NOT NULL,
`api_token_prefix` text NOT NULL,
`created_at` text DEFAULT (current_timestamp) NOT NULL,
`last_seen_at` text
);