lib.rs 37 lignes · 1275 octets
//! SeaORM migrations for the rustwarden-fediverse-guard crate.
//!
//! Single fused migration that creates the three tables backing the
//! guard runtime:
//!
//! - `fediverse_guard_events` (raw event log, sliding-window source)
//! - `fediverse_guard_bans` (active + historical bans)
//! - `fediverse_guard_acl` (manual allow / deny rules)
//!
//! The migrator uses a **dedicated** tracking table
//! `seaql_fediverse_guard_migrations` so it can be applied
//! independently of the core migrator.
//!
//! Run after both core and fediverse migrators:
//! ```bash
//! cargo run --bin migrate -- up
//! cargo run -p rustwarden-fediverse --bin migrate-fediverse -- up
//! cargo run -p rustwarden-fediverse-guard --bin migrate-fediverse-guard -- up
//! ```

pub use sea_orm_migration::prelude::*;

pub mod m20260514_000001_fediverse_guard_schema;

/// Migrator for the rustwarden-fediverse-guard crate.
pub struct FediverseGuardMigrator;

#[async_trait::async_trait]
impl MigratorTrait for FediverseGuardMigrator {
    fn migration_table_name() -> sea_orm::DynIden {
        Alias::new("seaql_fediverse_guard_migrations").into_iden()
    }

    fn migrations() -> Vec<Box<dyn MigrationTrait>> {
        vec![Box::new(m20260514_000001_fediverse_guard_schema::Migration)]
    }
}