Skip to main content

Module migration

Module migration 

Source
Expand description

Migration engine ?model snapshot diffing, migration generation, and history tracking.

Corresponds to EFCore’s migration system. Implements full model diffing:

  • Detect added/removed tables
  • Detect added/removed/altered columns
  • Generate Up/Down SQL with dialect-specific type mappings
  • Maintain __ef_migrations_history tracking table

Structs§

Migration
Represents a single migration with up/down SQL scripts.
MigrationEngine
The migration engine ?compares old and new model snapshots to generate migration SQL.
MigrationHistoryEntry
Represents a record in the migration history table. Table name: __ef_migrations_history Corresponds to EFCore’s __EFMigrationsHistory.
MigrationStore
Reads and writes migration scripts on disk.
ModelSnapshot
A snapshot of the entity model at a point in time. Corresponds to EFCore’s ModelSnapshot.
SnapshotColumn
Serialized form of PropertyMeta for snapshot storage.
SnapshotEntityType
Serialized form of EntityTypeMeta for snapshot storage.

Enums§

MigrationDialect
Specifies the database SQL dialect for migration generation.

Constants§

MIGRATION_HISTORY_TABLE
Table name for migration history.
PRODUCT_VERSION
Product version recorded in migration history.

Functions§

create_migration_history_table_sql
SQL to create the migration history table.
parse_model_snapshot_json
Parses a model snapshot JSON file (same format as MigrationStore::save_snapshot).