command
ridu migrate create
Plan and write one reviewable immutable migration artifact without connecting to a database.
Example
ridu migrate create --name rename-post-title
git diff -- migrations/Arguments
| Argument | Type | Description |
|---|---|---|
--name | string | Required lowercase kebab-case migration name. |
--accept-renames | boolean | Accept every unambiguous detected rename without an interactive prompt. PostgreSQL and MongoDB accept collection and field renames; SQLite accepts field renames only. |
--transform | string | SQLite or MongoDB: bind a named compiled data transform to the immutable artifact. |
--versions-existing | string | What 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-destructive | boolean | Record 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]