Good question — and yes, it's worth refactoring. The cleaner shape removes the need for a separate CLI utility entirely.
Today seedDefaultProfile (database.go:115) is:
- One hardcoded profile, inline in
database.go
- Skip condition:
count > 0 (i.e. only seeds an empty DB)
That count > 0 check is the real problem. It means: once any profile exists, no built-in profile can ever be added again. So if you ship a new preset in v1.2, no existing install will ever see it.
Cleanest shape
Move presets to a name-keyed registry, idempotent by name, runs on every startup:
internal/database/
database.go // calls ensureBuiltInProfiles(db)
profile_seeds.go // []models.TranscriptionProfile registry + ensure fn
go
Why this is cleanest
- One source of truth. Presets are typed Go values next to the model they target — schema drift is impossible.
- No new binary, no CLI auth, no Makefile target. The "utility" is just app startup.
- Forward-compatible. Add a 4th preset in a future release → it lands on every existing install without clobbering anything users have edited or renamed.
- Idempotent by name, not count. Survives partial deletes; doesn't fight user customization (we only insert when missing, never update).
The one tradeoff to call out
If a user deliberately deletes a built-in profile, it comes back on the next startup. Two ways to handle that:
- Accept it (my recommendation) — these are "built-ins", coming back is consistent with the name. Users who don't want them can rename them; renaming changes the key, so they won't be re-seeded.
- Track seeded-ness in a small table (
seeded_builtin_profiles(name TEXT PRIMARY KEY)) — only seed each name once, ever. Cleaner UX, but ~15 extra lines and a new table for a corner case.
I'd ship #1 and only move to #2 if it actually annoys someone.
What this means for your earlier ask
The "create a utility" task collapses into: refactor seedDefaultProfile → ensureBuiltInProfiles, add the two new presets to the slice, delete the count > 0 check. ~40 lines of diff, no new files, no new binary.
Want me to implement it?