SnipTray logo
Coding

Write a data migration

Forward path, failure path, and how to verify it.

  • migration
  • database
  • data safety

The prompt

I need a migration for: {{change}}
Stack: {{stack}}

Give me the migration, then answer three things: what happens to existing rows,
what happens if it fails halfway, and exactly how I would verify on a real
pre-migration copy that nothing was lost.

Say whether this can be automatic or needs a custom transform, and why. If any
part of it is destructive, name it explicitly.

What to fill in

{{change}}
The schema change — e.g. add two tables, touch nothing existing
{{stack}}
Stack — e.g. SwiftData with a VersionedSchema

117 prompts, in the app you already paste from

The whole library, searchable, with your own prompts alongside it. Free to browse here; Pro to keep them a keystroke away on every device.