Aias00 opened a new issue, #7589:
URL: https://github.com/apache/shenyu/issues/7589

   ## Summary
   
   The `selector` and `rule` tables use a column named **`loged`** — a 
misspelling of "logged". It appears ~211 times across the SQL schemas, the 
MyBatis mappers and the public Java DTOs, so it is baked into the REST API and 
the database contract.
   
   ## Evidence
   
   **Schema (all four dialects):**
   
   - `db/init/mysql/schema.sql` — `` `loged` tinyint(4) NOT NULL COMMENT 
'whether to print the log' ``
   - `db/init/pg/create-table.sql`
   - `db/init/oracle/schema.sql`
   - `shenyu-admin/src/main/resources/sql-script/h2/schema.sql:69,97`
   
   **MyBatis mappers:**
   
   - `shenyu-admin/src/main/resources/mappers/selector-sqlmap.xml` — lines 31, 
48, 65, 299, 314, 349–350, 391–392, 420, 454–455
   - `shenyu-admin/src/main/resources/mappers/rule-sqlmap.xml` — lines 30, 45, 
239, 251, 282–283
   
   **Public Java API:**
   
   - 
`shenyu-admin/src/main/java/org/apache/shenyu/admin/model/dto/SelectorDTO.java:88,91,134,148,284,286,289,293,295`
   - `shenyu-admin/src/main/java/org/apache/shenyu/admin/model/dto/RuleDTO.java`
   - 
`shenyu-admin/src/main/java/org/apache/shenyu/admin/utils/SelectorUtil.java:89` 
— `.loged(Boolean.TRUE)`
   
   Counts: 36 occurrences in `*.sql` / `*.xml`, 175 in non-test `*.java`.
   
   ## Impact
   
   - The typo is user-visible: it shows up in the admin REST payloads 
(`"loged": true`) and in any SQL users write against ShenYu's schema.
   - It propagates into every new plugin/selector/rule copy-paste, so the cost 
of fixing it grows over time.
   - `loged` is not an English word, which trips up new contributors and 
documentation readers.
   
   ## Suggested fix
   
   Because `loged` is part of the public REST contract and the persisted 
schema, this needs a deprecation path rather than a hard rename:
   
   1. **DB migration** — add `db/upgrade/2.7.1-upgrade-2.7.2-<dialect>.sql` 
statements (or a new upgrade script) doing `ALTER TABLE selector RENAME COLUMN 
loged TO logged;` and the same for `rule`, for each dialect (mysql / pg / 
oracle / og / ob / h2).
   2. **Java** — rename the field to `logged` in `SelectorDTO` / `RuleDTO` (and 
the corresponding DO/VO), and keep a deprecated `@JsonProperty("loged")` alias 
plus a `getLoged()`/`setLoged()` delegating pair for one release so existing 
API clients keep working.
   3. **Mappers** — update the `*-sqlmap.xml` files, and note that `h2` also 
needs the column renamed.
   4. **Release notes** — record the rename under `Unreleased → Behavior 
Changes`.
   
   If a full rename is considered too invasive for now, a lower-risk first step 
is to at least fix the Javadoc wording ("whether loged" → "whether to log") and 
add a code comment marking `loged` as a known typo slated for rename.
   
   ## Environment
   
   - Branch: `master` @ `a7d80b7`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to