[feat] refactor rule reserved keyword fields#6147
Merged
Aias00 merged 4 commits intoapache:masterfrom Sep 13, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
approved these changes
Sep 13, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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".
Make sure that:
./mvnw clean install -Dmaven.javadoc.skip=true.