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
51
52
53
54
55
56
57
58
59
60
61
//! The model registry and table-schema reflection used by `migrate generate`.
//!
//! `migrate generate` compares each model's intended schema against the live
//! database. To do that without the caller hand-listing every model, each
//! `#[derive(Model)]` submits a [`ModelSchemaEntry`] into a link-time registry
//! (via the `inventory` crate); [`registered_models`] reads them all back.
//!
//! This module is part of the `migrations` feature. It cannot live in the
//! standalone migration CLI binary, which never sees the application's Rust model
//! types — generate is therefore an application-embedded call.
use crateIndexDef;
use crateColumnDef;
/// The full intended schema of a model's table: its columns and its indexes.
///
/// Built from a [`Model`](crate::Model) via
/// [`Model::table_schema`](crate::Model::table_schema). It is the input to the
/// generate diff.
/// A registry entry contributed by one model.
///
/// Holds a function pointer to the model's schema reflection rather than the schema
/// itself, so registration stays a cheap `const` value.
collect!;
/// Returns the intended schema of every registered model.
///
/// A model is registered automatically by `#[derive(Model)]` when the
/// `migrations` feature is on. Only models linked into the running binary appear.