Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CELEBORN-1297][FOLLOWUP] Fix DB config service SQL file
### What changes were proposed in this pull request? Fix the unique key to reflect correct columns names. ### Why are the changes needed? Running current DB scripts give below error because `user` column was renamed to `name` (#2340) but the unique key was not updated correctly. ``` mysql> CREATE TABLE IF NOT EXISTS celeborn_cluster_tenant_config -> ( -> id int NOT NULL AUTO_INCREMENT, -> cluster_id int NOT NULL, -> tenant_id varchar(255) NOT NULL, -> level varchar(255) NOT NULL COMMENT 'config level, valid level is TENANT,USER', -> name varchar(255) DEFAULT NULL COMMENT 'tenant sub user', -> config_key varchar(255) NOT NULL, -> config_value varchar(255) NOT NULL, -> type varchar(255) DEFAULT NULL COMMENT 'conf categories, such as quota', -> gmt_create timestamp NOT NULL, -> gmt_modify timestamp NOT NULL, -> PRIMARY KEY (id), -> UNIQUE KEY `index_unique_tenant_config_key` (`cluster_id`, `tenant_id`, `user`, `config_key`) -> ); ERROR 1072 (42000): Key column 'user' doesn't exist in table ``` ### Does this PR introduce _any_ user-facing change? NA ### How was this patch tested? Tested in local DB ``` mysql> CREATE TABLE IF NOT EXISTS celeborn_cluster_tenant_config -> ( -> id int NOT NULL AUTO_INCREMENT, -> cluster_id int NOT NULL, -> tenant_id varchar(255) NOT NULL, -> level varchar(255) NOT NULL COMMENT 'config level, valid level is TENANT,USER', -> name varchar(255) DEFAULT NULL COMMENT 'tenant sub user', -> config_key varchar(255) NOT NULL, -> config_value varchar(255) NOT NULL, -> type varchar(255) DEFAULT NULL COMMENT 'conf categories, such as quota', -> gmt_create timestamp NOT NULL, -> gmt_modify timestamp NOT NULL, -> PRIMARY KEY (id), -> UNIQUE KEY `index_unique_tenant_config_key` (`cluster_id`, `tenant_id`, `name`, `config_key`) -> ); Query OK, 0 rows affected (0.01 sec) ``` Closes #2740 from s0nskar/fix-db-script. Authored-by: Sanskar Modi <[email protected]> Signed-off-by: Shuang <[email protected]> (cherry picked from commit b3f86f9) Signed-off-by: Shuang <[email protected]>
- Loading branch information