Skip to content

Conversation

@ezr-ondrej
Copy link
Member

@ezr-ondrej ezr-ondrej commented Nov 11, 2025

Add database migration to drop the system_profile_facts column and its associated GIN index from the hosts table.

🤖 Generated with Claude Code

Overview

This PR is being created to address RHINENG-21797]

Currently we only want to see the errors, to pin point what still depends on this column.
The final migration will most likely be another PR :)

Summary by Sourcery

Enhancements:

  • Add Alembic migration to drop the system_profile_facts column and its GIN index from the hosts table with a downgrade to restore them.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Nov 11, 2025

Reviewer's Guide

This PR introduces an Alembic migration that removes the system_profile_facts JSONB column and its GIN index from the hosts table in the upgrade path, while providing a downgrade path that re-adds both the column and index.

Entity Relationship diagram for hosts table after dropping system_profile_facts column

erDiagram
    hosts {
        bigint id PK
    }
Loading

Entity Relationship diagram for hosts table downgrade (restoring system_profile_facts column)

erDiagram
    hosts {
        bigint id PK
        jsonb system_profile_facts
    }
    hosts ||--o{ idxsystem_profile_facts : "GIN index on system_profile_facts"
Loading

File-Level Changes

Change Details Files
Add upgrade migration to drop system_profile_facts column and index
  • Drop GIN index on system_profile_facts
  • Remove system_profile_facts column from hosts table
migrations/versions/dfa988f7d77e_drop_system_profile_facts_column.py
Implement downgrade migration to restore column and index
  • Re-add system_profile_facts JSONB column (nullable)
  • Recreate GIN index on system_profile_facts
migrations/versions/dfa988f7d77e_drop_system_profile_facts_column.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@ezr-ondrej ezr-ondrej changed the title feat(RHINENG-21960): Drop system_profile_facts column from hosts table feat(RHINENG-21960): Drop system_profile_facts column and canonical_facts Nov 19, 2025
ezr-ondrej and others added 3 commits December 9, 2025 11:51
Add database migration to drop the system_profile_facts column and its associated GIN index from the hosts table.

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

Co-Authored-By: Claude <[email protected]>
Disable writes into the dropped columns, this initial draft just comments them out.
We'll see what fails and act accordingly.
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