Skip to content

fix(models): replace postgresql.UUID with database-agnostic UUID (#2495)#2532

Merged
mrveiss merged 1 commit intoDev_new_guifrom
fix/issue-2495
Mar 27, 2026
Merged

fix(models): replace postgresql.UUID with database-agnostic UUID (#2495)#2532
mrveiss merged 1 commit intoDev_new_guifrom
fix/issue-2495

Conversation

@mrveiss
Copy link
Owner

@mrveiss mrveiss commented Mar 27, 2026

Summary

  • Replaces sqlalchemy.dialects.postgresql.UUID with sqlalchemy.types.Uuid in 5 model files
  • Matches pattern from PR fix(backend): replace postgresql.UUID with dialect-neutral Uuid (#2402) #2424 for workflow_permission.py
  • sqlalchemy.types.Uuid is SQLAlchemy 2.0's dialect-neutral type: native UUID on PostgreSQL, 32-char string on SQLite
  • Enables SQLite compatibility for dev/test environments

Files Changed

  • autobot-backend/user_management/models/base.py — import + type_annotation_map + TenantMixin
  • autobot-backend/user_management/models/role.py — import + 9 columns
  • autobot-backend/user_management/models/mfa.py — import + 2 columns
  • autobot-backend/models/agent.py — import + 1 column
  • autobot-backend/models/agent_org.py — import + 1 column

Note

6 additional model files also use postgresql.UUID alongside JSONB — these need a separate fix (split import). Not in scope for this PR.

Closes #2495

Test plan

  • No remaining postgresql.UUID in the 5 fixed files
  • Python AST parse passes for all changed files
  • Backend starts without import errors

@github-actions
Copy link

✅ SSOT Configuration Compliance: Passing

🎉 No hardcoded values detected that have SSOT config equivalents!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant