#![allow(clippy::too_many_arguments)]

pub use sea_orm_migration::prelude::*;

mod m20260410_000001_create_tenant;
mod m20260411_000002_create_users;
mod m20260411_000003_create_user_credentials;
mod m20260411_000004_create_user_tokens;
mod m20260411_000005_create_roles;
mod m20260411_000006_create_permissions;
mod m20260411_000007_create_role_permissions;
mod m20260411_000008_create_user_roles;
mod m20260411_000009_create_organizations;
mod m20260411_000010_create_departments;
mod m20260411_000011_create_positions;
mod m20260412_000012_create_dictionaries;
mod m20260412_000013_create_dictionary_items;
mod m20260412_000014_create_menus;
mod m20260412_000015_create_menu_roles;
mod m20260412_000016_create_settings;
mod m20260412_000017_create_numbering_rules;
mod m20260412_000018_create_process_definitions;
mod m20260412_000019_create_process_instances;
mod m20260412_000020_create_tokens;
mod m20260412_000021_create_tasks;
mod m20260412_000022_create_process_variables;
mod m20260413_000023_create_message_templates;
mod m20260413_000024_create_messages;
mod m20260413_000025_create_message_subscriptions;
mod m20260413_000026_create_audit_logs;
mod m20260414_000027_fix_unique_indexes_soft_delete;
mod m20260414_000028_add_standard_fields_to_tokens;
mod m20260414_000029_add_standard_fields_to_process_variables;
mod m20260415_000030_add_version_to_message_tables;
mod m20260416_000031_create_domain_events;
mod m20260414_000032_fix_settings_unique_index_null;
mod m20260417_000033_create_plugins;
mod m20260417_000034_seed_plugin_permissions;
mod m20260418_000035_pg_trgm_and_entity_columns;
mod m20260418_000036_add_data_scope_to_role_permissions;
mod m20260419_000037_create_user_departments;
mod m20260419_000039_entity_registry_columns;
mod m20260419_000040_plugin_market;
mod m20260419_000041_plugin_user_views;
mod m20260423_000043_create_wechat_users;
mod m20260427_000062_create_tenant_crypto_keys;
mod m20260427_000084_domain_events_cleanup;
mod m20260427_000085_processed_events;
mod m20260427_000086_enable_rls_all_tables;
mod m20260427_000087_audit_logs_hash_chain;
mod m20260428_000088_rls_policy_strict;
mod m20260428_000089_blind_indexes;
mod m20260428_000091_dead_letter_events;
mod m20260504_000106_create_api_clients;
mod m20260513_000144_enforce_version_optimistic_lock;
mod m20260518_000149_fix_admin_permissions;
mod m20260529_000169_supplement_rls_for_new_tables;
mod m20260613_000170_drop_wechat_users;

pub struct Migrator;

#[async_trait::async_trait]
impl MigratorTrait for Migrator {
    fn migrations() -> Vec<Box<dyn MigrationTrait>> {
        vec![
            Box::new(m20260410_000001_create_tenant::Migration),
            Box::new(m20260411_000002_create_users::Migration),
            Box::new(m20260411_000003_create_user_credentials::Migration),
            Box::new(m20260411_000004_create_user_tokens::Migration),
            Box::new(m20260411_000005_create_roles::Migration),
            Box::new(m20260411_000006_create_permissions::Migration),
            Box::new(m20260411_000007_create_role_permissions::Migration),
            Box::new(m20260411_000008_create_user_roles::Migration),
            Box::new(m20260411_000009_create_organizations::Migration),
            Box::new(m20260411_000010_create_departments::Migration),
            Box::new(m20260411_000011_create_positions::Migration),
            Box::new(m20260412_000012_create_dictionaries::Migration),
            Box::new(m20260412_000013_create_dictionary_items::Migration),
            Box::new(m20260412_000014_create_menus::Migration),
            Box::new(m20260412_000015_create_menu_roles::Migration),
            Box::new(m20260412_000016_create_settings::Migration),
            Box::new(m20260412_000017_create_numbering_rules::Migration),
            Box::new(m20260412_000018_create_process_definitions::Migration),
            Box::new(m20260412_000019_create_process_instances::Migration),
            Box::new(m20260412_000020_create_tokens::Migration),
            Box::new(m20260412_000021_create_tasks::Migration),
            Box::new(m20260412_000022_create_process_variables::Migration),
            Box::new(m20260413_000023_create_message_templates::Migration),
            Box::new(m20260413_000024_create_messages::Migration),
            Box::new(m20260413_000025_create_message_subscriptions::Migration),
            Box::new(m20260413_000026_create_audit_logs::Migration),
            Box::new(m20260414_000027_fix_unique_indexes_soft_delete::Migration),
            Box::new(m20260414_000028_add_standard_fields_to_tokens::Migration),
            Box::new(m20260414_000029_add_standard_fields_to_process_variables::Migration),
            Box::new(m20260415_000030_add_version_to_message_tables::Migration),
            Box::new(m20260416_000031_create_domain_events::Migration),
            Box::new(m20260414_000032_fix_settings_unique_index_null::Migration),
            Box::new(m20260417_000033_create_plugins::Migration),
            Box::new(m20260417_000034_seed_plugin_permissions::Migration),
            Box::new(m20260418_000035_pg_trgm_and_entity_columns::Migration),
            Box::new(m20260418_000036_add_data_scope_to_role_permissions::Migration),
            Box::new(m20260419_000037_create_user_departments::Migration),
            Box::new(m20260419_000039_entity_registry_columns::Migration),
            Box::new(m20260419_000040_plugin_market::Migration),
            Box::new(m20260419_000041_plugin_user_views::Migration),
            Box::new(m20260423_000043_create_wechat_users::Migration),
            Box::new(m20260427_000062_create_tenant_crypto_keys::Migration),
            Box::new(m20260427_000084_domain_events_cleanup::Migration),
            Box::new(m20260427_000085_processed_events::Migration),
            Box::new(m20260427_000086_enable_rls_all_tables::Migration),
            Box::new(m20260427_000087_audit_logs_hash_chain::Migration),
            Box::new(m20260428_000088_rls_policy_strict::Migration),
            Box::new(m20260428_000089_blind_indexes::Migration),
            Box::new(m20260428_000091_dead_letter_events::Migration),
            Box::new(m20260504_000106_create_api_clients::Migration),
            Box::new(m20260513_000144_enforce_version_optimistic_lock::Migration),
            Box::new(m20260518_000149_fix_admin_permissions::Migration),
            Box::new(m20260529_000169_supplement_rls_for_new_tables::Migration),
            Box::new(m20260613_000170_drop_wechat_users::Migration),
        ]
    }
}
