ruanwenjun commented on code in PR #16064:
URL:
https://github.com/apache/dolphinscheduler/pull/16064#discussion_r1613119394
##########
dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_h2.sql:
##########
@@ -1092,6 +1092,9 @@ INSERT INTO t_ds_user
VALUES ('1', 'admin', '7ad2410b2f4c074479a8937a28a22b8f', '0', '[email protected]',
'', '-1', '2018-03-27 15:48:50',
'2018-10-24 17:40:22', null, 1, null);
+-- If the admin account is not associated with a tenant, the admin's tenant
will be set to the default tenant.
+UPDATE `t_ds_user` SET `tenant_id` = '-1' WHERE (`user_name` = 'admin') AND
(`tenant_id` = '0');
+
Review Comment:
```suggestion
-- If the admin account is not associated with a tenant, the admin's tenant
will be set to the default tenant.
UPDATE `t_ds_user` SET `tenant_id` = '-1' WHERE (`user_name` = 'admin') AND
(`tenant_id` = '0');
```
This is not needed, since the default value is -1, and admin's tenantId is -1
##########
dolphinscheduler-dao/src/main/resources/sql/upgrade/3.2.0_schema/mysql/dolphinscheduler_dml.sql:
##########
@@ -30,6 +30,9 @@ END IF;
END;
d//
+-- If the admin account is not associated with a tenant, the admin's tenant
will be set to the default tenant.
+UPDATE `t_ds_user` SET `tenant_id` = '-1' WHERE (`user_name` = 'admin') AND
(`tenant_id` = '0');
+
Review Comment:
```suggestion
-- If the admin account is not associated with a tenant, the admin's tenant
will be set to the default tenant.
UPDATE `t_ds_user` SET `tenant_id` = '-1' WHERE `tenant_id` = '0';
```
##########
dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_postgresql.sql:
##########
@@ -1053,6 +1053,9 @@ VALUES ('admin', '7ad2410b2f4c074479a8937a28a22b8f', '0',
'[email protected]', '', '-1'
INSERT INTO t_ds_tenant(id, tenant_code, description, queue_id, create_time,
update_time)
VALUES (-1, 'default', 'default tenant', '1', '2018-03-27 15:48:50',
'2018-10-24 17:40:22');
+-- If the admin account is not associated with a tenant, the admin's tenant
will be set to the default tenant.
+UPDATE `t_ds_user` SET `tenant_id` = '-1' WHERE (`user_name` = 'admin') AND
(`tenant_id` = '0');
+
Review Comment:
```suggestion
-- If the admin account is not associated with a tenant, the admin's tenant
will be set to the default tenant.
UPDATE `t_ds_user` SET `tenant_id` = '-1' WHERE (`user_name` = 'admin') AND
(`tenant_id` = '0');
```
##########
dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql:
##########
@@ -1062,6 +1062,9 @@ VALUES (NULL, 1, 'global alert group', 'global alert
group', current_timestamp,
INSERT IGNORE INTO `t_ds_user`
VALUES ('1', 'admin', '7ad2410b2f4c074479a8937a28a22b8f', '0', '[email protected]',
'', '-1', current_timestamp, current_timestamp, null, 1, null);
+-- If the admin account is not associated with a tenant, the admin's tenant
will be set to the default tenant.
+UPDATE `t_ds_user` SET `tenant_id` = '-1' WHERE (`user_name` = 'admin') AND
(`tenant_id` = '0');
+
Review Comment:
```suggestion
-- If the admin account is not associated with a tenant, the admin's tenant
will be set to the default tenant.
UPDATE `t_ds_user` SET `tenant_id` = '-1' WHERE (`user_name` = 'admin') AND
(`tenant_id` = '0');
```
##########
dolphinscheduler-dao/src/main/resources/sql/upgrade/3.2.0_schema/postgresql/dolphinscheduler_dml.sql:
##########
@@ -21,6 +21,9 @@ INSERT INTO t_ds_tenant(id, tenant_code, description,
queue_id, create_time, upd
UPDATE t_ds_schedules as t1 SET tenant_code = COALESCE(t3.tenant_code,
'default') FROM t_ds_process_definition as t2 LEFT JOIN t_ds_tenant t3 ON
t2.tenant_id = t3.id WHERE t1.process_definition_code = t2.code;
UPDATE t_ds_process_instance SET tenant_code = 'default' WHERE tenant_code IS
NULL;
+-- If the admin account is not associated with a tenant, the admin's tenant
will be set to the default tenant.
+UPDATE `t_ds_user` SET `tenant_id` = '-1' WHERE (`user_name` = 'admin') AND
(`tenant_id` = '0');
+
Review Comment:
```suggestion
-- If the admin account is not associated with a tenant, the admin's tenant
will be set to the default tenant.
UPDATE `t_ds_user` SET `tenant_id` = '-1' WHERE `tenant_id` = '0';
```
--
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]