impress/db
Emi Matchu 604a8667cf feat: add write lock for AuthUser migration preparation
This commit implements a temporary write lock on the AuthUser model to
prepare for consolidating the openneo_id database into the main database.

Changes:
- AuthUser: Added before_save/before_destroy callbacks that raise
  TemporarilyReadOnly exception to prevent any writes
- AuthUser: Override update_tracked_fields! to silently skip Devise login
  tracking (prevents crashes during login while maintaining read access)
- ApplicationController: Added rescue_from handler for TemporarilyReadOnly
  that redirects to root with a friendly maintenance message
- Migration: Created CopyAuthUsersTableToMainDatabase to copy
  openneo_id.users → openneo_impress.auth_users (preserves all IDs)

This allows us to run the data copy migration in production while:
- Keeping existing users able to log in and use the site
- Blocking new registrations, settings changes, and NeoPass connections
- Losing some login tracking data (acceptable tradeoff)

Next step: Deploy this, then run the migration in production while the
table is stable.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 06:50:55 +00:00
..
migrate feat: add write lock for AuthUser migration preparation 2025-11-02 06:50:55 +00:00
openneo_id_migrate Connect a NeoPass to an existing account 2024-04-08 05:33:58 -07:00
openneo_id_schema.rb Add configurable full name field to alt styles 2025-02-15 21:52:47 -08:00
schema.rb feat: add write lock for AuthUser migration preparation 2025-11-02 06:50:55 +00:00
seeds.rb Move fundraising models into the Fundraising module 2024-02-18 20:29:31 -08:00