pilichoumao opened a new issue, #6209:
URL: https://github.com/apache/rocketmq-dashboard/issues/6209
### Before Creating the Bug Report
- [x] Searched related issues and PRs; no equivalent fix found.
- [x] This concerns RocketMQ Studio deployment SQL.
- [x] Exact branch and commit are stated below.
### Studio Version
`rocketmq-studio` at `5e4c39b053c35a5598cc79ff331b8a54e649d7b1`.
### Runtime Environment
macOS host; isolated official MySQL 8.0.46 container. No production database
or credentials involved. This is a direct execution of deployment SQL, not a
browser reproduction.
### Connected RocketMQ Cluster
Not needed: the failure concerns database schema compatibility.
### Describe the Bug
`deploy/mysql/upgrade-cloud-vendor.sql` creates missing
`rmq_cloud_credential` tables with a `VARCHAR(64)` primary key and `created_at`
/ `updated_at`. The current canonical schema and `RmqCloudCredential` instead
require an auto-generated numeric ID and `gmt_create` / `gmt_modified`. The
same script adds a missing `rmq_instance.credential_id` as `VARCHAR(64)`, while
its current mapping and canonical schema use BIGINT.
Consequently, running the helper on a database missing these objects creates
a credential table that current application queries and inserts cannot use.
`CloudCredentialSchemaMigration` adds an index and foreign key; it does not
convert these columns.
### Steps to Reproduce
Use a disposable MySQL database, create this minimal existing-instance
fixture, then execute the complete baseline `upgrade-cloud-vendor.sql`:
```sql
CREATE TABLE rmq_instance (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(128) NOT NULL,
type VARCHAR(32) NOT NULL,
endpoint VARCHAR(512) NOT NULL
);
```
Afterward, run:
```sql
SELECT id, gmt_create, gmt_modified FROM rmq_cloud_credential;
INSERT INTO rmq_cloud_credential (name, vendor, access_key, secret_key)
VALUES ('test-credential', 'ALIYUN', 'synthetic-ak', 'dGVzdA==');
```
### What Did You Expect to See?
The helper should create credential columns compatible with the current
entity mapping: queries succeed, credential inserts generate a numeric ID, and
new credential references have the matching numeric type.
### What Did You See Instead?
MySQL 8.0.46 reproduced both failures:
```text
ERROR 1054 (42S22): Unknown column 'gmt_create' in 'field list'
ERROR 1364 (HY000): Field 'id' doesn't have a default value
```
### Additional Context
A narrow fix can align only the DDL for missing tables/columns and add
regression coverage. It should explicitly leave already-created incompatible
columns unchanged; converting existing UUID references or historical schemas is
a separate migration problem.
The local candidate passes a full-script MySQL matrix (fresh missing
objects, repeat execution with retained data, canonical schema, and partially
upgraded columns). Backend tests with official RocketMQ dependencies pass: 3435
tests, zero failures/errors, three skipped. Packaging still hits the baseline
binary-license gate; its 164 dependency JAR findings match the baseline CI
exactly. The H2 regression test exercises the actual DDL statements, not MySQL
PREPARE/EXECUTE guards.
### Are You Willing to Submit a Pull Request?
- [x] Yes, I am willing to submit a pull request.
--
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]