sea_orm

Derive Macro DeriveMigrationName

Source
#[derive(DeriveMigrationName)]
Expand description

The DeriveMigrationName derive macro will implement sea_orm_migration::MigrationName for a migration.

ยงUsage

โ“˜
#[derive(DeriveMigrationName)]
pub struct Migration;

The derive macro above will provide following implementation, given the file name is m20220120_000001_create_post_table.rs.

โ“˜
impl MigrationName for Migration {
    fn name(&self) -> &str {
        "m20220120_000001_create_post_table"
    }
}