Skip to content

feat(db): implement real migration status reporting #459

Description

@GaspardKirira

Summary

Implement migration status reporting for file-based migrations.

The current CLI accepts the status command but only prints the migrations directory and a placeholder message.

Current behavior

vix orm status reaches the DB migrator, but the migrator does not compare migration files with the migration tracking table.

Users cannot currently see:

  • applied migrations;
  • pending migrations;
  • modified migrations;
  • missing migration files;
  • the last applied migration.

Expected behavior

The migration runner must expose enough information for the CLI to display the current migration state without modifying the database schema.

Scope

  • Add an internal migration status representation.
  • List discovered migration files.
  • List applied migration records.
  • Mark migrations as applied or pending.
  • Detect checksum mismatches.
  • Detect applied migrations whose files are missing.
  • Display results through vix_db_migrator status.
  • Return a non-zero status when migration history is inconsistent.
  • Preserve the existing migration commands and public DB API.

Suggested files

  • modules/db/include/vix/db/mig/FileMigrationsRunner.hpp
  • modules/db/src/mig/FileMigrationsRunner.cpp
  • modules/db/tools/migrator/MigratorCLI.cpp
  • modules/db/tests/file_migrations_runner_test.cpp

Acceptance criteria

  • Applied migrations are displayed.
  • Pending migrations are displayed.
  • Modified applied migrations are clearly identified.
  • Missing applied migration files are clearly identified.
  • Status does not apply or roll back migrations.
  • Consistent migration history exits successfully.
  • Inconsistent migration history exits with failure.
  • Existing public DB usage remains compatible.

Non-goals

This issue does not include:

  • an interactive migration UI;
  • automatic repair of migration history;
  • ORM migration status;
  • migration generation.

Suggested labels

  • scope:db
  • type:feature
  • good first issue
  • status:ready

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersscope:dbDatabase driversstatus:readyIssue is fully specified and ready for implementationtype:featureNew functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions