public sealed class MetaMigrationChainThe steps that take a .meta document from an older envelope schema to the current one.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
metaVersion is a real version with a real chain behind it, not a magic constant that never changes. Each step takes a document from version n to n + 1 and is applied in order, so a file five versions old is upgraded by five small, individually reviewable functions rather than by one that has to know every historical shape at once.
Steps work on the node tree, not on the model. A migration exists precisely because the old document does not fit the current type; binding it first is impossible by construction. Working on nodes also means a step can move a key, rename it, or split it, and the byte-fidelity emitter writes the result out with everything the step did not touch — including comments — exactly as it found it.
There are no steps yet, and that is the point of shipping the mechanism now. The chain is exercised by tests with steps of their own, so that the first real migration is one function rather than a design.
Fields and properties (3)
public const int CurrentVersionThe envelope schema version this build writes.
public static MetaMigrationChain CurrentThe chain the engine uses.
public int TargetVersionWhat this chain upgrades to.
Methods (4)
public MetaMigrationChain(int targetVersion = 1)Creates a chain.
public MetaMigrationChain Add(int fromVersion, Action<YamlMapping> step)Adds a step.
public int Apply(YamlMapping root)Brings a document up to date, in place.
public static int VersionOf(YamlMapping root)What version a document says it is.
Used by (4)
- AssetMetaVixen.Core.Yaml
- AssetMetaFileVixen.Core.Yaml
- MetaTestsVixen.Core.Yaml.Tests
- AssetDatabaseVixen.Editor.Core