Skip to content

Conversation

@2823602869
Copy link
Contributor

fix #6137

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.

@2823602869
Copy link
Contributor Author

I'll fix this

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 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 required to is_required in param and field tables 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 isRequired as 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.

Comment on lines 71 to 75
<dependency>
<groupId>com.alibaba.fastjson2</groupId>
<artifactId>fastjson2</artifactId>
<version>${fastjson2.version}</version>
</dependency>
Copy link

Copilot AI Nov 19, 2025

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.

Suggested change
<dependency>
<groupId>com.alibaba.fastjson2</groupId>
<artifactId>fastjson2</artifactId>
<version>${fastjson2.version}</version>
</dependency>

Copilot uses AI. Check for mistakes.
@Aias00 Aias00 merged commit 5d92e50 into apache:master Nov 22, 2025
42 of 43 checks passed
@Aias00
Copy link
Contributor

Aias00 commented Nov 22, 2025

add my wechat pls: aias00

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.

[Task] Identify and Refactor Reserved Keyword Fields in Shenyu Admin SQL for Database Compatibility

2 participants