rustango 0.48.0

Django-shaped batteries-included web framework for Rust: ORM + migrations + auto-admin + multi-tenancy + audit log + auth (sessions, JWT, OAuth2/OIDC, HMAC) + APIs (ViewSet, OpenAPI auto-derive, JSON:API) + jobs (in-mem + Postgres) + email + media (S3 / R2 / B2 / MinIO + presigned uploads + collections + tags) + production middleware (CSRF, CSP, rate-limiting, compression, idempotency, etc.).
Documentation
//! 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::apply_system_migrations`). This is the
//! normal Django 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())
}