Skip to content

Fix/#8994 - #9013

Open
bujjibabukatta wants to merge 2 commits into
apache:mainfrom
bujjibabukatta:fix/#8994
Open

Fix/#8994#9013
bujjibabukatta wants to merge 2 commits into
apache:mainfrom
bujjibabukatta:fix/#8994

Conversation

@bujjibabukatta

Copy link
Copy Markdown
Contributor

Summary

Closes #8994. Several component columns across the domain and tool layers were still varchar(N) instead of text, causing potential truncation and inconsistency with the rest of the codebase, where component has already been standardized to text for issue-tracking tables.

Changes

Struct type changes (Component field → text):

  • core/models/domainlayer/code/pull_request.go
  • core/models/domainlayer/ticket/incident.go
  • core/models/domainlayer/codequality/cq_issues.go
  • plugins/gitlab/models/mr.go
  • plugins/bitbucket/models/pr.go
  • plugins/bitbucket_server/models/pr.go
  • plugins/gitee/models/pull_request.go
  • plugins/github/models/pr.go
  • plugins/sonarqube/models/sonarqube_hotspot.go (also drops the now-unnecessary index on component, since a text column can't be indexed the same way as varchar)

New migration scripts (8), one per affected table, each calling ModifyColumnType to alter the column at the DB level for existing installations:

  • core/models/migrationscripts/20260722_change_pull_request_component_to_text.go
  • core/models/migrationscripts/20260722_change_incident_component_to_text.go
  • plugins/gitlab/models/migrationscripts/20260722_change_mr_component_to_text.go
  • plugins/bitbucket/models/migrationscripts/20260722_change_pr_component_to_text.go
  • plugins/bitbucket_server/models/migrationscripts/20260722_change_pr_component_to_text.go
  • plugins/gitee/models/migrationscripts/20260722_change_pr_component_to_text.go
  • plugins/github/models/migrationscripts/20260722_change_pr_component_to_text.go
  • plugins/sonarqube/models/migrationscripts/20260722_change_hotspot_component_to_text.go (drops the component index before altering the column type)

Registered each new migration script in its corresponding register.go.

Testing

  • go build ./... passes cleanly.
  • Verified struct tags match the intended text type for all 9 affected models.
  • Verified each migration script's target table name matches the model's TableName().

@bujjibabukatta

Copy link
Copy Markdown
Contributor Author

@klesh can you please review and approve ?

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.

[Refactor][Database columns] Standardize component column type across all database tables

1 participant