Milvex. Migration. Operation
(milvex v0.14.0)
Copy Markdown
Single unit of work exchanged between Milvex.Migration.Plan,
Milvex.Migration.Runner, and Milvex.Migration.Reporter.
An Operation describes one logical schema mutation (add/alter/drop a field,
create/alter/recreate/drop an index, add/alter/drop a function, alter
collection KV, create collection) plus the metadata needed to display, plan
releases for, and serialise it.
Categories:
:additive— safe forward-compatible change (adds capability):destructive— removes data or capability; may need release on olderMilvus versions:impossible— diff cannot be reconciled in-place; report only:descriptive— comment / description update; no schema effect
requires_release is derived from (kind, milvus_version) by
requires_release?/2. Modern Milvus (>= 2.6.0) is permissive: drops do not
require release. Older versions need release for field/function drops. Index
drops and recreations always require release.
Summary
Functions
Builds an operation, deriving requires_release from (kind, version).
Returns whether the given operation kind requires the collection to be released before it can be applied on the given Milvus version.
Renders the operation as one line of iodata for the text reporter.
Converts the operation to a JSON-serialisable map.
Types
@type category() :: :additive | :destructive | :impossible | :descriptive
@type kind() ::
:create_collection
| :add_field
| :alter_field
| :drop_field
| :description_change
| :create_index
| :drop_index
| :recreate_index
| :add_function
| :alter_function
| :drop_function
Functions
Builds an operation, deriving requires_release from (kind, version).
Pass reason: "..." in opts to attach a human explanation, used for
:impossible ops in the reporter.
Returns whether the given operation kind requires the collection to be released before it can be applied on the given Milvus version.
:drop_index,:recreate_index— always true:drop_field,:drop_function— true only on Milvus < 2.6.0- everything else — false
Renders the operation as one line of iodata for the text reporter.
The first character is a sigil derived from the category:
:additive→+:destructive→-:descriptive→~:impossible→!
Converts the operation to a JSON-serialisable map.
Each kind has a clause normalising its payload to a canonical shape: field/index/function structs are projected to small maps containing only identifying keys.