Skip to content
1 min read · 146 words

Class: VectorMigrator

Defined in: src/batteries/vector/migrate.ts:48

Knex-style migration runner: applies pending migrations forward and rolls the last one back.

Constructors

Constructor

ts
new VectorMigrator(opts: VectorMigrateOptions): VectorMigrator;

Defined in: src/batteries/vector/migrate.ts:56

Parameters

ParameterTypeDescription
optsVectorMigrateOptionsThe migrations, ledger, and schema facade to run against.

Returns

VectorMigrator

Methods

latest()

ts
latest(): Promise<string[]>;

Defined in: src/batteries/vector/migrate.ts:68

Apply every not-yet-applied migration in order, recording each in the ledger.

Returns

Promise<string[]>

The names of the migrations applied during this run.

Throws

@nhtio/adk/batteries!E_VECTOR_STORE_MIGRATION_FAILED when a migration's up throws.


rollback()

ts
rollback(): Promise<string | null>;

Defined in: src/batteries/vector/migrate.ts:95

Reverse the most recently applied migration and remove it from the ledger.

Returns

Promise<string | null>

The name of the rolled-back migration, or null when nothing was applied.

Throws

@nhtio/adk/batteries!E_VECTOR_STORE_MIGRATION_FAILED when the migration module is missing or its down throws.