1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! Schema migration support for database evolution.
//!
//! This module provides mechanisms to manage database schema changes over time.
//! As applications evolve, their data structures change, and migrations enable
//! safe transformation of existing data.
//!
//! # Migration Process
//!
//! A migration:
//! 1. Defines source and target schema versions
//! 2. Specifies transformation steps for affected data
//! 3. Is executed automatically when opening a database with a different schema version
//!
//! # Creating Migrations
//!
//! ```rust,ignore
//! use nitrite::migration::{Migration, MigrationStep};
//!
//! let migration = Migration::create(1, 2)
//! .add_instruction(/* ... */)
//! .finalize();
//!
//! let db = Nitrite::builder()
//! .schema_version(2)
//! .add_migration(migration)
//! .open_or_create(None, None)?;
//! ```
//!
//! # Migration Types
//!
//! - **Collection Instructions**: Add/remove collections, create indexes
//! - **Repository Instructions**: Define object repository structure
//! - **Database Instructions**: Global database-level changes
//!
//! # Atomicity
//!
//! Migrations are applied atomically - either all changes succeed or none are applied.
//! If a migration fails, the database is rolled back to its previous state.
pub use *;
pub use MigrationManager;
pub use ;