Skip to content

Module migration application is gated to non-production/SQLite — packaged modules need a production migration path #258

@antosubash

Description

@antosubash

Found during module-packaging Session 1.

UseSimpleModuleInfrastructure only initializes databases when !IsProduction() || provider == Sqlite (framework/SimpleModule.Hosting/SimpleModuleHostExtensions.cs). Session 1 added per-module MigrateAsync for module DbContexts that bundle migrations, but it inherits the same gating — so a packaged module installed into a production PostgreSQL host never gets its migrations applied at startup.

Planned resolution (Session 2): sm add applies module migrations explicitly at install time, and sm doctor reports pending module migrations. Consider also an opt-in SimpleModuleOptions flag for startup migration of module contexts in production.

Related: the EnsureCreated→Migrate transition caveat documented in docs/site/advanced/module-packaging.md.

Metadata

Metadata

Assignees

No one assigned

    Labels

    packagingModule packaging & distribution

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions