command

ridu migrate create

Plan and write one reviewable immutable migration artifact without connecting to a database.

Example

shell
ridu migrate create --name rename-post-title
git diff -- migrations/

Arguments

ArgumentTypeDescription
--namestringRequired lowercase kebab-case migration name.
--accept-renamesbooleanAccept every unambiguous detected rename without an interactive prompt. PostgreSQL and MongoDB accept collection and field renames; SQLite accepts field renames only.
--transformstringSQLite or MongoDB: bind a named compiled data transform to the immutable artifact.
--versions-existingstringWhat the stored documents of every collection or global that starts keeping versions become: published, draft (needs drafts) or require-empty. Without it, create asks in a terminal and otherwise fails.
--allow-destructivebooleanRecord destructive changes confirmed by the selected adapter planner after explicit review.

How it works

A collection or global that starts keeping versions needs a recorded choice about its stored documents, from --versions-existing or a prompt; enable versions in a migration without renames or transforms.

Rename candidates require confirmation or --accept-renames. SQLite confirms field renames this way and uses --transform for any other rewrite of stored canonical JSON; one SQLite migration takes either renames or a transform. MongoDB transforms run through the compiled project migration driver. Destructive approval does not bypass semantic transitions Ridu cannot safely automate.

Full signature

ridu migrate create (<kebab-name> | --name <kebab-name>) [--accept-renames | --transform <name>] [--versions-existing <published|draft|require-empty>] [--allow-destructive]