modo_db/entity.rs
1use sea_orm::schema::SchemaBuilder;
2
3/// Registration info for a SeaORM entity, collected via `inventory`.
4///
5/// The `#[modo_db::entity]` macro generates an `inventory::submit!` block
6/// for each entity. Framework entities (migrations, sessions)
7/// register themselves identically with `is_framework: true`.
8///
9/// Do not construct this struct directly — use the `#[modo_db::entity]`
10/// attribute macro instead.
11pub struct EntityRegistration {
12 pub table_name: &'static str,
13 pub group: &'static str,
14 pub register_fn: fn(SchemaBuilder) -> SchemaBuilder,
15 pub is_framework: bool,
16 pub extra_sql: &'static [&'static str],
17}
18
19inventory::collect!(EntityRegistration);