Skip to content

Fix PostgreSQL compatibility by removing JSON column index - #33

Merged
MarkProminic merged 1 commit into
mainfrom
devin/1727258350-postgresql-compatibility-fix
Sep 25, 2025
Merged

MarkProminic merged 1 commit into
mainfrom
devin/1727258350-postgresql-compatibility-fix

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Fix PostgreSQL compatibility by removing JSON column index

Summary

Removes the problematic permissions field index from the User model that was causing PostgreSQL database initialization failures. PostgreSQL requires specific operator classes for JSON column indexes, causing a "data type json has no default operator class for access method btree" error during Sequelize table creation.

This change maintains full functionality while enabling PostgreSQL support - permissions queries will work identically, just without index optimization on that specific column.

Review & Testing Checklist for Human

  • Verify PostgreSQL database initialization works end-to-end - Test complete setup with schema ownership fix (ALTER SCHEMA public OWNER TO armor_user;) and confirm no database errors during startup
  • Test permissions system functionality - Verify user authentication, authorization checks, and OIDC user management still work correctly with PostgreSQL
  • Confirm SQLite compatibility maintained - Test that the default SQLite configuration still works without any regressions
  • Validate production deployment process - Ensure the combination of this code change + PostgreSQL schema ownership configuration resolves the production database errors

Notes

This fix addresses the critical PostgreSQL compatibility issue identified in production logs. The complete setup requires both this code change AND the PostgreSQL schema ownership fix (sudo -u postgres psql -d armor_db -c "ALTER SCHEMA public OWNER TO armor_user;").

Link to Devin run: https://app.devin.ai/sessions/30b40362482e42109b8243b6c7a36ca3
Requested by: @MarkProminic

- Remove permissions field index that causes PostgreSQL btree operator class error
- Maintains functionality while fixing PostgreSQL compatibility
- Permissions queries will still work, just without index optimization

Co-Authored-By: mark.gilbert@prominic.net <mark.gilbert@prominic.net>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@MarkProminic
MarkProminic merged commit 5c2db90 into main Sep 25, 2025
1 of 4 checks passed
@MarkProminic
MarkProminic deleted the devin/1727258350-postgresql-compatibility-fix branch September 25, 2025 10:39
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