Files
triggershell/app/drizzle/0000_thick_reaper.sql
T
valknarandClaude Sonnet 5 ced99a8e75 Initial implementation of TriggerShell
A Python CLI (typer) that bootstraps Node/pnpm and launches a Next.js 16 web
app for running configured shell scripts: YAML config validated by a shared
Zod schema, dynamic per-script forms mapped to shadcn controls, argv-safe
execa execution with live WebSocket streaming, SQLite/Drizzle run history,
and optional argon2 session + API token auth.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-15 18:37:30 +02:00

38 lines
1.2 KiB
SQL

CREATE TABLE `api_tokens` (
`id` text PRIMARY KEY NOT NULL,
`name` text NOT NULL,
`token_hash` text NOT NULL,
`created_at` integer NOT NULL,
`last_used_at` integer
);
--> statement-breakpoint
CREATE UNIQUE INDEX `api_tokens_name_unique` ON `api_tokens` (`name`);--> statement-breakpoint
CREATE TABLE `runs` (
`id` text PRIMARY KEY NOT NULL,
`script_id` text NOT NULL,
`script_name` text NOT NULL,
`status` text DEFAULT 'queued' NOT NULL,
`variables` text NOT NULL,
`resolved_command` text NOT NULL,
`pid` integer,
`exit_code` integer,
`started_at` integer,
`ended_at` integer,
`timeout_seconds` integer,
`triggered_by` text NOT NULL,
`log_file_path` text NOT NULL,
`error_message` text,
`created_at` integer NOT NULL
);
--> statement-breakpoint
CREATE INDEX `runs_script_id_idx` ON `runs` (`script_id`);--> statement-breakpoint
CREATE INDEX `runs_status_idx` ON `runs` (`status`);--> statement-breakpoint
CREATE TABLE `users` (
`id` text PRIMARY KEY NOT NULL,
`username` text NOT NULL,
`password_hash` text NOT NULL,
`created_at` integer NOT NULL,
`last_login_at` integer
);
--> statement-breakpoint
CREATE UNIQUE INDEX `users_username_unique` ON `users` (`username`);