Skip to content

Conversation

@Wweiei
Copy link
Contributor

@Wweiei Wweiei commented Sep 10, 2025

feat:refactor rule reserved keyword fields. #6137
This PR refactors rule reserved keyword fields by renaming two database columns in the "rule" table to avoid reserved keyword conflicts. The changes rename "name" to "rule_name" and "sort" to "sort_code".

  • Renamed database column "name" to "rule_name" across all database schemas and related code
  • Renamed database column "sort" to "sort_code" across all database schemas and related code
  • Updated all corresponding Java entity classes, mappers, and service implementations to use the new field names

Make sure that:

  • You have read the contribution guidelines.
  • You submit test cases (unit or integration tests) that back your changes.
  • Your local test passed ./mvnw clean install -Dmaven.javadoc.skip=true.

@Aias00 Aias00 requested a review from Copilot September 12, 2025 02:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors rule reserved keyword fields by renaming two database columns in the "rule" table to avoid reserved keyword conflicts. The changes rename "name" to "rule_name" and "sort" to "sort_code".

  • Renamed database column "name" to "rule_name" across all database schemas and related code
  • Renamed database column "sort" to "sort_code" across all database schemas and related code
  • Updated all corresponding Java entity classes, mappers, and service implementations to use the new field names

Reviewed Changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
shenyu-admin/src/test/java/org/apache/shenyu/admin/mapper/RuleMapperTest.java Updated test methods to use new field names getRuleName() and setSortCode()
shenyu-admin/src/main/resources/sql-script/h2/schema.sql Updated H2 schema to rename columns from "name" to "rule_name" and "sort" to "sort_code"
shenyu-admin/src/main/resources/mappers/rule-sqlmap.xml Updated MyBatis XML mapping to use new column names and property mappings
shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/RuleServiceImpl.java Updated service implementation to use getRuleName() instead of getName()
shenyu-admin/src/main/java/org/apache/shenyu/admin/model/vo/RuleVO.java Updated view object to use new field names in buildRuleVO method
shenyu-admin/src/main/java/org/apache/shenyu/admin/model/vo/DataPermissionPageVO.java Updated to use getRuleName() in buildPageVOByRule method
shenyu-admin/src/main/java/org/apache/shenyu/admin/model/event/rule/RuleChangedEvent.java Updated event class to use getRuleName() and getSortCode()
shenyu-admin/src/main/java/org/apache/shenyu/admin/model/event/rule/BatchRuleDeletedEvent.java Updated batch event to use getRuleName()
shenyu-admin/src/main/java/org/apache/shenyu/admin/model/entity/RuleDO.java Renamed fields from name/sort to ruleName/sortCode with corresponding getters/setters
shenyu-admin/src/main/java/org/apache/shenyu/admin/mapper/RuleMapper.java Removed unused import and updated return type
Multiple database upgrade scripts Added column rename statements for all supported database types
Multiple database init scripts Updated table creation scripts with new column names

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Aias00 Aias00 added this to the 2.7.0.3 milestone Sep 13, 2025
@Aias00 Aias00 merged commit da78f46 into apache:master Sep 13, 2025
43 checks passed
@Wweiei Wweiei deleted the feat/refactor-reserved-keyword-fields-rule branch September 17, 2025 03:06
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.

2 participants