mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #382] [MERGED] fix: auto-migrate lorebook folders on startup #4598
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#4598
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/382
Author: @TheLonelyDevil9
Created: 5/3/2026
Status: ✅ Merged
Merged: 5/3/2026
Merged by: @TheLonelyDevil9
Base:
main← Head:codex/fix-lorebook-folder-startup-migration📝 Commits (2)
5ef0357fix: auto-migrate lorebook folders on startupba485d2test: preserve legacy lorebook rows during migration📊 Changes
3 files changed (+194 additions, -0 deletions)
View changed files
➕
AGENTS.md(+65 -0)📝
packages/server/src/db/migrate.ts(+20 -0)➕
packages/server/test/db-migrations.test.ts(+109 -0)📄 Description
Summary
lorebook_folderstable.lorebook_entries.folder_idstartup migration for existing installs.AGENTS.mdmaintainer instructions.Why
Existing installs can hit
no such table: lorebook_foldersafter updating, which breaks lorebook UI/API flows unless users manually run database commands. This makes the migration seamless during normal app startup.Linked Issue
No linked issue exists yet. Per
CONTRIBUTING.md, one should be opened before this PR is submitted/merged; this PR is based on live user reports of upgraded installs failing withno such table: lorebook_folders.Test Plan
no such table: lorebook_folders.Manual Verification Notes
Manual app/browser verification is still needed before merge. Recommended flow: start from an install/database created before lorebook folders existed, update to this branch, launch normally, open the lorebooks panel, confirm existing entries render, then create/toggle/delete a folder and refresh.
Automated Validation Run Locally
pnpm --filter @marinara-engine/server exec tsx --test test/db-migrations.test.tsdrizzle-kit push --forceagainst a throwaway SQLite filepnpm checkSummary by CodeRabbit
Tests
Chores
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.