Files
triggershell/drizzle/0000_thick_reaper.sql
valknarandClaude Sonnet 5 3f379ca2ac Flatten the repo: move everything out of app/ to the root
Now that the CLI and the Next.js app are one package, nesting it inside
app/ served no purpose - the repo root itself becomes the published
npm package. Merges app/.gitignore and app/README.md into the root
versions, drops the now-duplicate app/LICENSE, and updates path
references (README, docs/ARCHITECTURE.md, docs/CONFIG_REFERENCE.md,
package.json's repository.directory) that assumed the app/ nesting.

Also fixes a real bug this surfaced: the in-app docs viewer resolved
docs/ relative to process.cwd(), which only worked by accident when the
CLI happened to be invoked from app/'s parent directory. A first attempt
at fixing it with import.meta.dirname broke instead, for the same
cross-module-graph reason config-path resolution already documented -
Next compiles Route Handlers through a separate module graph that
doesn't preserve source-relative import.meta paths. Fixed by exposing
the app root via TRIGGERSHELL_APP_ROOT (set once in server.ts, where
import.meta *does* resolve correctly), the same pattern already used
for TRIGGERSHELL_CONFIG_PATH.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-16 11:14:01 +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`);