Skip to content

Refactor persistence commands for DB migration#38

Merged
pablonete merged 1 commit into
mainfrom
pablonete-plan-netlify-db-migration
Jun 24, 2026
Merged

Refactor persistence commands for DB migration#38
pablonete merged 1 commit into
mainfrom
pablonete-plan-netlify-db-migration

Conversation

@pablonete

Copy link
Copy Markdown
Member

Blob-backed read-modify-write paths are making the storage layer hard to migrate safely to Netlify DB. This PR introduces the first migration slice: a command-oriented persistence boundary that preserves current file/blob behavior while giving future DB and dual-write adapters explicit operations to implement.

Summary

  • Adds store commands for kid registration, passport completion, prize catalog writes, prize awards, and admin restore.
  • Rewires API write handlers to call those commands instead of generic snapshot mutators.
  • Keeps app-owned IDs and timestamps explicit where dual-write correctness depends on deterministic values.
  • Shares the command helpers across file and Netlify Blob adapters so current behavior stays aligned.
  • Updates storage docs to point future writable state migration toward Netlify DB behind the store interface.

Notes for review

  • This does not add the Netlify DB adapter yet; it prepares the seam for the next PR.
  • Magic-link tokens remain on their existing token store in this slice, but are planned for the first DB migration scope.
  • No UI changes; screenshots are N/A.

Validation

  • npm run --silent lint
  • npm run --silent build
  • npm run --silent build:server

Move server write paths onto command-oriented store operations so file and blob adapters share the same registration, passport, prize, award, and restore behavior. This prepares the persistence seam for Netlify DB and dual-write rollout while preserving current API responses.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@netlify

netlify Bot commented Jun 24, 2026

Copy link
Copy Markdown

Deploy Preview for kid-a ready!

Name Link
🔨 Latest commit 3b595da
🔍 Latest deploy log https://app.netlify.com/projects/kid-a/deploys/6a3c425b8142be000888bdfb
😎 Deploy Preview https://deploy-preview-38--kid-a.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@pablonete pablonete merged commit 36d3be6 into main Jun 24, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant