Skip to content
This repository was archived by the owner on Feb 21, 2026. It is now read-only.

[Upstream PR #237] Versioned DB migration framework + channel column #102

@Peyton-Spencer

Description

@Peyton-Spencer

Summary

Upstream PR: qwibitai#237
Author: astoreyai (Aaron Storey)
Status: OPEN
Changes: +138 / -10 LOC, 8 files

Replaces ad-hoc try/catch ALTER TABLE pattern with proper versioned migration framework. Adds channel column to registered_groups for multi-channel routing.

Key Changes

  1. Migration Framework (src/db.ts)

    • New schema_version table (single-row, version integer)
    • runMigrations() applies pending migrations sequentially
    • Migration 1: context_mode column (previously ad-hoc try/catch)
    • Migration 2: channel column on registered_groups
  2. Type Changes (src/types.ts)

    • RegisteredGroup.channel: string - Identifies owning channel (e.g., 'whatsapp', 'telegram', 'slack')
  3. IPC Changes (src/ipc.ts)

    • register_group command accepts optional channel field, defaults to 'whatsapp'
  4. Tests

    • 4 new tests for channel storage, retrieval, multi-channel routing, migration idempotency
    • All existing test fixtures updated with channel: 'whatsapp'
    • 143/143 tests pass

Architecture Benefits

  • Proper migrations - Sequential, versioned, idempotent
  • Multi-channel support - Same group JID can exist on different channels
  • Backward compatible - Existing DBs auto-migrate, default to 'whatsapp'
  • Testable - Migration framework is unit tested

Risk

MEDIUM

  • Database schema changes (migration risk)
  • Requires testing with existing databases
  • Could break if migration fails mid-process

Recommendation

🟡 MONITOR

OmniAura Considerations

  • We already have multi-backend support (apple-container, sprites, etc.)
  • Adding multi-channel support makes sense
  • Need to test migration path on our production DBs

Action Items

  • Wait for upstream merge
  • Test migration on backup of production DB
  • Consider adopting after proven stable
  • Verify no conflicts with our custom schema changes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions