Skip to content

[CLI] Add support for incremental database migrations #4

@coderabbitai

Description

@coderabbitai

Context

Currently, schema changes to the PDK database (e.g., adding the device_subclass column in PR #2) are handled by deleting the existing database on every pdk scan run. While this ensures the schema is always up-to-date, it prevents incremental scanning and requires full workspace rescans each time.

Desired Behavior

Implement a migration system that:

  • Detects existing databases and their schema version
  • Applies incremental migrations (e.g., ALTER TABLE statements) to bring older databases up to date
  • Preserves existing data during schema updates
  • Supports version tracking to enable safe migrations

References

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions