-
Notifications
You must be signed in to change notification settings - Fork 3k
fix field-sqlmap.xml database reserved keywords #6233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I'll fix this |
There was a problem hiding this 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 addresses issue #6137 by renaming the database column required to is_required in the param and field tables across all supported database systems. The column name "required" is a reserved keyword in some databases (particularly PostgreSQL), which can cause issues with SQL queries. The changes ensure consistency across MySQL, PostgreSQL, Oracle, OceanBase, and openGauss database schemas.
Key Changes
- Renamed database column from
requiredtois_requiredinparamandfieldtables across all database init and upgrade scripts - Updated MyBatis XML mappers to reference the new column name
is_required - Modified Java entity classes (ParameterDO and FieldDO) to use
isRequiredas the private field name while maintaining backward-compatible getter/setter method names
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| shenyu-examples/pom.xml | Adds fastjson2 dependency (appears unrelated to the PR's stated purpose) |
| shenyu-admin/src/main/resources/sql-script/h2/schema.sql | Updates H2 schema to rename required column to is_required |
| shenyu-admin/src/main/resources/mappers/parameter-sqlmap.xml | Updates all SQL mappings to reference is_required column and isRequired property |
| shenyu-admin/src/main/resources/mappers/field-sqlmap.xml | Updates all SQL mappings to reference is_required column and isRequired property |
| shenyu-admin/src/main/java/org/apache/shenyu/admin/model/entity/ParameterDO.java | Changes internal field from required to isRequired, maintains getter/setter method names for backward compatibility |
| shenyu-admin/src/main/java/org/apache/shenyu/admin/model/entity/FieldDO.java | Changes internal field from required to isRequired, maintains getter/setter method names for backward compatibility |
| db/upgrade/2.5.0-upgrade-2.5.1-pg.sql | Updates PostgreSQL upgrade script with corrected column name |
| db/upgrade/2.5.0-upgrade-2.5.1-oracle.sql | Updates Oracle upgrade script with corrected column name |
| db/upgrade/2.5.0-upgrade-2.5.1-mysql.sql | Updates MySQL upgrade script with corrected column name |
| db/init/pg/create-table.sql | Updates PostgreSQL init script with corrected column name |
| db/init/oracle/schema.sql | Updates Oracle init script with corrected column name |
| db/init/og/create-table.sql | Updates openGauss init script with corrected column name |
| db/init/ob/schema.sql | Updates OceanBase init script with corrected column name |
| db/init/mysql/schema.sql | Updates MySQL init script with corrected column name |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
shenyu-admin/src/main/java/org/apache/shenyu/admin/model/entity/FieldDO.java
Show resolved
Hide resolved
shenyu-examples/pom.xml
Outdated
| <dependency> | ||
| <groupId>com.alibaba.fastjson2</groupId> | ||
| <artifactId>fastjson2</artifactId> | ||
| <version>${fastjson2.version}</version> | ||
| </dependency> |
Copilot
AI
Nov 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This dependency addition appears unrelated to the PR's stated purpose of fixing database reserved keywords. The PR title and description mention fixing field-sqlmap.xml database reserved keywords, but this change adds a fastjson2 dependency to the examples module. This unrelated change should either be removed or explained in a separate PR.
| <dependency> | |
| <groupId>com.alibaba.fastjson2</groupId> | |
| <artifactId>fastjson2</artifactId> | |
| <version>${fastjson2.version}</version> | |
| </dependency> |
shenyu-admin/src/main/java/org/apache/shenyu/admin/model/entity/FieldDO.java
Show resolved
Hide resolved
shenyu-admin/src/main/java/org/apache/shenyu/admin/model/entity/FieldDO.java
Show resolved
Hide resolved
shenyu-admin/src/main/java/org/apache/shenyu/admin/model/entity/FieldDO.java
Show resolved
Hide resolved
shenyu-admin/src/main/java/org/apache/shenyu/admin/model/entity/FieldDO.java
Show resolved
Hide resolved
shenyu-admin/src/main/java/org/apache/shenyu/admin/model/entity/ParameterDO.java
Show resolved
Hide resolved
# Conflicts: # shenyu-examples/pom.xml
|
add my wechat pls: aias00 |
fix #6137
Make sure that:
./mvnw clean install -Dmaven.javadoc.skip=true.