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
//! Tenancy init — now a no-op.
//!
//! The framework no longer ships hand-built bootstrap migrations. Its
//! own tables (`rustango_orgs`, `rustango_users`, roles/permissions, …)
//! are generated by `makemigrations` into the project's
//! `system/migrations/` folder — and, at provisioning time, generated
//! on demand from the compiled models and applied under a dedicated
//! ledger (see `tenancy::migrate::migrate_with_system`). That is
//! the normal flow: models → makemigrations → migrate.
//!
//! [`init_tenancy`] is retained as a no-op so the existing wiring (the
//! server `Builder`, the `init-tenancy` manage verb) keeps compiling; it
//! writes nothing.
use std::path::Path;
use super::auth::{TenantUserModel, User};
use super::error::TenancyError;
/// Outcome of [`init_tenancy`]. Both lists are always empty now — the
/// framework ships no bootstrap migrations to materialize.
#[derive(Debug, Default)]
pub struct InitTenancyReport {
/// Migration names freshly written (always empty).
pub written: Vec<String>,
/// Migration names skipped because they already existed (always
/// empty).
pub skipped: Vec<String>,
}
/// No-op (v0.47). The framework's tables come from makemigrations-
/// generated `system/migrations/`, not hand-built bootstrap JSON.
///
/// # Errors
/// Never — retained for signature compatibility with existing wiring.
pub fn init_tenancy(dir: &Path) -> Result<InitTenancyReport, TenancyError> {
init_tenancy_with::<User>(dir)
}
/// No-op generic form — see [`init_tenancy`]. The `U` type parameter is
/// retained so the server `Builder::user_model` wiring type-checks.
///
/// # Errors
/// Never.
pub fn init_tenancy_with<U: TenantUserModel>(
_dir: &Path,
) -> Result<InitTenancyReport, TenancyError> {
Ok(InitTenancyReport::default())
}