Feature: Dynamic Migration Execution #3

Closed
opened 2026-06-25 19:30:21 +00:00 by psycodepath · 0 comments
Owner

Motivation

As new tenants are added dynamically, their SQLite database files will be created from scratch and need all tables migrated to the latest schema version.

Description

Modify the startup migration execution so that MigrationRunner is executed dynamically on the tenant's database when the database is initialized or when a tenant is first accessed.

User Story

As a host, I want new tenant databases to be automatically migrated to the latest schema so that I do not need to run manual setup commands.

Gherkin Feature

Feature: Dynamic Migration Execution
  As a system administrator
  I want new tenant databases to be migrated automatically
  So that the application runs error-free

  Scenario: Tenant database created
    Given a new tenant "family2" accesses the site
    When the database connection is initialized
    Then the migration runner should run all pending migrations on "var/tenant_family2.sqlite"

Acceptance Criteria

  • MigrationRunner runs dynamically for the resolved tenant database on demand.
  • A caching or check mechanism ensures we do not perform migration checks repeatedly on every request.
  • Handled safely during concurrent requests.
### Motivation As new tenants are added dynamically, their SQLite database files will be created from scratch and need all tables migrated to the latest schema version. ### Description Modify the startup migration execution so that `MigrationRunner` is executed dynamically on the tenant's database when the database is initialized or when a tenant is first accessed. ### User Story As a host, I want new tenant databases to be automatically migrated to the latest schema so that I do not need to run manual setup commands. ### Gherkin Feature ```gherkin Feature: Dynamic Migration Execution As a system administrator I want new tenant databases to be migrated automatically So that the application runs error-free Scenario: Tenant database created Given a new tenant "family2" accesses the site When the database connection is initialized Then the migration runner should run all pending migrations on "var/tenant_family2.sqlite" ``` ### Acceptance Criteria - [ ] `MigrationRunner` runs dynamically for the resolved tenant database on demand. - [ ] A caching or check mechanism ensures we do not perform migration checks repeatedly on every request. - [ ] Handled safely during concurrent requests.
Sign in to join this conversation.
No labels
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
psycodepath/hrp#3
No description provided.