Table of Contents

Class ConfigSchemaVersion

Namespace
JD.AI.Core.Config
Assembly
JD.AI.Core.dll

Tracks configuration schema versions and provides migration support. Schema versions are stored alongside config files and checked on load to detect when migration is needed.

public sealed class ConfigSchemaVersion
Inheritance
ConfigSchemaVersion
Inherited Members

Constructors

ConfigSchemaVersion(string, ILogger?)

public ConfigSchemaVersion(string dataDir, ILogger? logger = null)

Parameters

dataDir string

Directory where version metadata is stored (typically ~/.jdai/).

logger ILogger

Optional logger.

Fields

CurrentVersion

Current schema version for JD.AI configuration.

public const int CurrentVersion = 1

Field Value

int

Methods

ApplyMigrations()

Runs all pending migrations from stored version to current version. Returns the number of migrations applied.

public int ApplyMigrations()

Returns

int

GetStoredVersion()

Reads the stored schema version, or returns 0 if no version file exists (indicating a pre-versioning installation).

public int GetStoredVersion()

Returns

int

NeedsMigration()

Checks if migration is needed by comparing stored version to current.

public bool NeedsMigration()

Returns

bool

StampCurrentVersion()

Stamps the current schema version after a successful migration or fresh install.

public void StampCurrentVersion()