nix: set up project-wide formatter

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I4806c58aa0a17f504c9312723ad770166a6a6964
This commit is contained in:
raf 2026-03-22 23:42:02 +03:00
commit 9e5eb41d39
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
78 changed files with 7406 additions and 2504 deletions

View file

@ -1,19 +1,19 @@
-- Add file_mtime column to media_items table for incremental scanning
-- Stores Unix timestamp in seconds of the file's modification time
ALTER TABLE media_items ADD COLUMN file_mtime BIGINT;
ALTER TABLE media_items
ADD COLUMN file_mtime BIGINT;
-- Create index for quick mtime lookups
CREATE INDEX IF NOT EXISTS idx_media_items_file_mtime ON media_items(file_mtime);
CREATE INDEX IF NOT EXISTS idx_media_items_file_mtime ON media_items (file_mtime);
-- Create a scan_history table to track when each directory was last scanned
CREATE TABLE IF NOT EXISTS scan_history (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
directory TEXT NOT NULL UNIQUE,
last_scan_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
files_scanned INTEGER NOT NULL DEFAULT 0,
files_changed INTEGER NOT NULL DEFAULT 0,
scan_duration_ms INTEGER
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
directory TEXT NOT NULL UNIQUE,
last_scan_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
files_scanned INTEGER NOT NULL DEFAULT 0,
files_changed INTEGER NOT NULL DEFAULT 0,
scan_duration_ms INTEGER
);
CREATE INDEX IF NOT EXISTS idx_scan_history_directory ON scan_history(directory);
CREATE INDEX IF NOT EXISTS idx_scan_history_directory ON scan_history (directory);