The LDAP migration (20251226) ran batch_alter_table on the invitation and
user tables with PRAGMA foreign_keys=ON. In SQLite, DROP TABLE with FKs
enabled triggers an implicit DELETE FROM that fires ON DELETE CASCADE,
silently wiping every row in invitation_user. This caused the "Latest
Accepted Invites" card to show blank after updating to v2026.3.0.
- Extend PRAGMA foreign_keys=OFF to cover all batch_alter_table operations
in both upgrade() and downgrade()
- Add repair migration that repopulates invitation_user from
invitation.used_by_id and user.code matching (same logic as the
original 20250814 migration)
Closes#1207