Initial commit

This commit is contained in:
kikootwo
2026-01-28 11:41:24 -05:00
commit a3ba192fbd
257 changed files with 89482 additions and 0 deletions
@@ -0,0 +1,21 @@
-- CreateTable
CREATE TABLE "job_events" (
"id" TEXT NOT NULL,
"job_id" TEXT NOT NULL,
"level" TEXT NOT NULL,
"context" TEXT NOT NULL,
"message" TEXT NOT NULL,
"metadata" JSONB,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "job_events_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE INDEX "job_events_job_id_idx" ON "job_events"("job_id");
-- CreateIndex
CREATE INDEX "job_events_created_at_idx" ON "job_events"("created_at");
-- AddForeignKey
ALTER TABLE "job_events" ADD CONSTRAINT "job_events_job_id_fkey" FOREIGN KEY ("job_id") REFERENCES "jobs"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,14 @@
-- DropForeignKey
ALTER TABLE "bookdate_config" DROP CONSTRAINT "bookdate_config_user_id_fkey";
-- DropIndex
DROP INDEX "bookdate_config_user_id_idx";
-- DropIndex
DROP INDEX "bookdate_config_user_id_key";
-- AlterTable: Remove userId column and user relation
ALTER TABLE "bookdate_config" DROP COLUMN "user_id";
-- Note: This migration converts BookDateConfig from per-user to a single global configuration
-- managed by admins. Any existing per-user configs will be removed except the first one found.
@@ -0,0 +1,16 @@
-- Add metadata tagging configuration
-- This allows admin to enable/disable automatic metadata tagging of audio files during file organization
-- Insert default configuration for metadata tagging (enabled by default)
INSERT INTO configuration (id, key, value, encrypted, category, description, created_at, updated_at)
VALUES (
gen_random_uuid(),
'metadata_tagging_enabled',
'true',
false,
'automation',
'Automatically tag audio files (m4b, mp3) with correct metadata (title, author, narrator) during file organization. Improves Plex matching accuracy.',
NOW(),
NOW()
)
ON CONFLICT (key) DO NOTHING;
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "scheduled_jobs" ADD COLUMN "last_run_job_id" TEXT;