DOTNETPROJECTS / THE MIGRATION MANUAL

Know what changes.
Know how it runs.

From your first table to deployment locks and SQLite reconstruction. Practical guides with a Classic and Fluent example for every authoring task.

Start with a working example ↗

01Introduction

  • Your first migration ↗

    Create a SQLite database, apply a versioned change, and write its reverse. Choose either C# style; the runner is the same.

  • Installation ↗

    The core library, database driver, optional DI integration and CLI each have a distinct job.

  • Configuration ↗

    Select the connection, migration set and history scope first, then set runner options before executing.

  • Frequently asked questions ↗

    Decisions to make before adopting the library or moving an existing migration project.

02Operations

  • Creating tables ↗

    Describe a complete table: columns first, with explicit named keys and constraints.

  • Altering tables ↗

    Rename objects and evolve populated tables while preserving the schema details you still need.

  • Columns and data types ↗

    Type, size, precision, nullability, defaults, identity and collation are explicit column attributes.

  • Data operations ↗

    Insert, update and delete using explicit column/value arrays. Keep predicates separate from changed values.

  • Schema inspection ↗

    Read the connected database before deciding what to change. Metadata is different from a model snapshot.

  • Execute SQL and scripts ↗

    Use schema operations where they fit, and keep database-specific SQL explicit.

  • Commands and callbacks ↗

    Use the active provider connection when a migration needs driver-level work.

03Schema basics

  • Indexes ↗

    An index is a separate schema object, even when it enforces uniqueness.

  • Keys and constraints ↗

    Declare table invariants independently of column attributes.

  • Foreign keys ↗

    Define ordered child/parent columns and independent actions for update and delete.

  • Defaults and collations ↗

    Distinguish values from SQL expressions, and comparison intent from a provider's installed collation name.

04Migration runners

05Migration types

06Database providers

  • Provider overview ↗

    One authoring contract, explicit database behavior. Choose the driver and provider together.

  • SQLite ↗

    Change existing tables from the live schema, without maintaining an ORM model.

  • SQL Server ↗

    Explicit keys, provider-specific indexes, transactional DDL and application locks.

  • PostgreSQL ↗

    Native intervals, schema-aware metadata, transactional DDL and advisory locks.

  • MySQL and MariaDB ↗

    Related providers with explicit engine, collation and DDL transaction differences.

  • Oracle ↗

    Preserve explicit constraints and be deliberate about identity, sequences and implicit DDL commits.

  • HANA and additional providers ↗

    Use the live-engine matrix to qualify operations beyond the common database families.

07Advanced topics

08Reference