You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bigtop.apache.org by "HalimKim (via GitHub)" <gi...@apache.org> on 2024/07/26 15:27:03 UTC

[PR] BIGTOP-4173 : DDL file to create all related tables (MySQL) [bigtop-manager]

HalimKim opened a new pull request, #27:
URL: https://github.com/apache/bigtop-manager/pull/27

   (no comment)


-- 
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: dev-unsubscribe@bigtop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] BIGTOP-4173 : DDL file to create all related tables (MySQL) [bigtop-manager]

Posted by "kevinw66 (via GitHub)" <gi...@apache.org>.
kevinw66 commented on PR #27:
URL: https://github.com/apache/bigtop-manager/pull/27#issuecomment-2254811392

   Looks like ci is failed, could you help fix it?


-- 
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: dev-unsubscribe@bigtop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] BIGTOP-4173 : DDL file to create all related tables (MySQL) [bigtop-manager]

Posted by "HalimKim (via GitHub)" <gi...@apache.org>.
HalimKim commented on code in PR #27:
URL: https://github.com/apache/bigtop-manager/pull/27#discussion_r1694617535


##########
bigtop-manager-server/src/main/resources/ddl/MySQL-DDL-CREATE.sql:
##########
@@ -22,24 +22,49 @@
 -- DROP DATABASE IF EXISTS `ambari`;
 -- DROP USER `ambari`;
 
-# delimiter ;
+#
+delimiter ;
 
-# CREATE DATABASE `bigtop_manager` /*!40100 DEFAULT CHARACTER SET utf8 */;
+# CREATE
+DATABASE `bigtop_manager` /*!40100 DEFAULT CHARACTER SET utf8 */;
 #
-# CREATE USER 'bigtop_manager' IDENTIFIED BY 'bigdata';
+# CREATE
+USER 'bigtop_manager' IDENTIFIED BY 'bigdata';
 
-# USE @schema;
+#
+USE @schema;

Review Comment:
   oops, my IDE did that i will correct this.



-- 
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: dev-unsubscribe@bigtop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] BIGTOP-4173 : DDL file to create all related tables (MySQL) [bigtop-manager]

Posted by "HalimKim (via GitHub)" <gi...@apache.org>.
HalimKim commented on code in PR #27:
URL: https://github.com/apache/bigtop-manager/pull/27#discussion_r1694047277


##########
bigtop-manager-server/src/main/resources/application.yml:
##########
@@ -58,7 +58,7 @@ spring:
     show-sql: true
     properties:
       eclipselink:
-        ddl-generation: create-or-extend-tables
+        ddl-generation: create-tables

Review Comment:
   setting it as 'none' doesn't insert into sequence table, I think i should add insert query in the ddl file like ambari did.
   
   https://github.com/apache/ambari/blob/trunk/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql#L1159-L1218
   
   After some test, I will correct the code. thank you



-- 
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: dev-unsubscribe@bigtop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] BIGTOP-4173 : DDL file to create all related tables (MySQL) [bigtop-manager]

Posted by "kevinw66 (via GitHub)" <gi...@apache.org>.
kevinw66 merged PR #27:
URL: https://github.com/apache/bigtop-manager/pull/27


-- 
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: dev-unsubscribe@bigtop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] BIGTOP-4173 : DDL file to create all related tables (MySQL) [bigtop-manager]

Posted by "HalimKim (via GitHub)" <gi...@apache.org>.
HalimKim commented on code in PR #27:
URL: https://github.com/apache/bigtop-manager/pull/27#discussion_r1694047095


##########
bigtop-manager-server/src/main/resources/ddl/MySQL-DDL-CREATE.sql:
##########
@@ -58,89 +75,255 @@ CREATE TABLE `user`
     `status`      BIT(1)      DEFAULT 1 COMMENT '0-Disable, 1-Enable',
     `create_time` DATETIME    DEFAULT NULL,
     `update_time` DATETIME    DEFAULT NULL,
+    `create_by`   BIGINT,
+    `update_by`   BIGINT,
     PRIMARY KEY (`id`),
     UNIQUE KEY `uk_username` (`username`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
 
 CREATE TABLE `cluster`
 (
-    `id`           BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-    `cluster_name` VARCHAR(255) DEFAULT NULL COMMENT 'Cluster Name',
-    `cluster_desc` VARCHAR(255) DEFAULT NULL COMMENT 'Cluster Name',
-    `cluster_type` SMALLINT UNSIGNED DEFAULT 1 COMMENT '1-Physical Machine, 2-Kubernetes',
-    `selected`     BIT(1)      DEFAULT 1 COMMENT '0-Disable, 1-Enable',
-    `create_time`  DATETIME     DEFAULT NULL,
-    `update_time`  DATETIME     DEFAULT NULL,
+    `id`            BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+    `cluster_name`  VARCHAR(255) DEFAULT NULL COMMENT 'Cluster Name',
+    `cluster_desc`  VARCHAR(255) DEFAULT NULL COMMENT 'Cluster Name',

Review Comment:
   Thank you checking, I will add comments



-- 
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: dev-unsubscribe@bigtop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] BIGTOP-4173 : DDL file to create all related tables (MySQL) [bigtop-manager]

Posted by "HalimKim (via GitHub)" <gi...@apache.org>.
HalimKim commented on PR #27:
URL: https://github.com/apache/bigtop-manager/pull/27#issuecomment-2254830780

   > Looks like ci is failed, could you help fix it?
   @kevinw66 
   
   CI Test builds without SkipTests and uses postgres as a meta db.
   looks like not using ddl file instead depending on JPA ddl auto generation.
   
   There will be 2 possible resolutions
   
   1. fix the ci and test file to use mysql and the ddl file.
   2. leave ddl-generation 'create-or-extend-tables'.
   
   what do you think? which one seems better?


-- 
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: dev-unsubscribe@bigtop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] BIGTOP-4173 : DDL file to create all related tables (MySQL) [bigtop-manager]

Posted by "kevinw66 (via GitHub)" <gi...@apache.org>.
kevinw66 commented on PR #27:
URL: https://github.com/apache/bigtop-manager/pull/27#issuecomment-2254845825

   BTW, I think we need to add a sql to insert default admin user here, `INSERT INTO user (id, username, password, nickname, status, create_time, update_time)VALUES (1, 'admin', '21232f297a57a5a743894a0e4a801fc3', 'Administrator', true, now(), now());`


-- 
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: dev-unsubscribe@bigtop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] BIGTOP-4173 : DDL file to create all related tables (MySQL) [bigtop-manager]

Posted by "HalimKim (via GitHub)" <gi...@apache.org>.
HalimKim commented on PR #27:
URL: https://github.com/apache/bigtop-manager/pull/27#issuecomment-2254881252

   @kevinw66 
   Thank you for sharing your idea.
   
   I agree with your idea adding SkipTests and unit tests later. but for now, it will be really helpful that CI include build and test.(even just executing server) so I prefer leaving ddl-generation 'create-or-extend-tables' for now.
   
   inserting default admin user will be good for testing, I will add another insert query.


-- 
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: dev-unsubscribe@bigtop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] BIGTOP-4173 : DDL file to create all related tables (MySQL) [bigtop-manager]

Posted by "kevinw66 (via GitHub)" <gi...@apache.org>.
kevinw66 commented on code in PR #27:
URL: https://github.com/apache/bigtop-manager/pull/27#discussion_r1694607232


##########
bigtop-manager-server/src/main/resources/ddl/MySQL-DDL-CREATE.sql:
##########
@@ -22,24 +22,49 @@
 -- DROP DATABASE IF EXISTS `ambari`;
 -- DROP USER `ambari`;

Review Comment:
   We can remove this



##########
bigtop-manager-server/src/main/resources/ddl/MySQL-DDL-CREATE.sql:
##########
@@ -22,24 +22,49 @@
 -- DROP DATABASE IF EXISTS `ambari`;
 -- DROP USER `ambari`;
 
-# delimiter ;
+#
+delimiter ;
 
-# CREATE DATABASE `bigtop_manager` /*!40100 DEFAULT CHARACTER SET utf8 */;
+# CREATE
+DATABASE `bigtop_manager` /*!40100 DEFAULT CHARACTER SET utf8 */;
 #
-# CREATE USER 'bigtop_manager' IDENTIFIED BY 'bigdata';
+# CREATE
+USER 'bigtop_manager' IDENTIFIED BY 'bigdata';
 
-# USE @schema;
+#
+USE @schema;
 
 -- Set default_storage_engine to InnoDB
 -- storage_engine variable should be used for versions prior to MySQL 5.6
-set @version_short = substring_index(@@version, '.', 2);
-set @major = cast(substring_index(@version_short, '.', 1) as SIGNED);
-set @minor = cast(substring_index(@version_short, '.', -1) as SIGNED);
-set @engine_stmt = IF((@major >= 5 AND @minor>=6) or @major >= 8, 'SET default_storage_engine=INNODB', 'SET storage_engine=INNODB');
+set
+@version_short = substring_index(@@version, '.', 2);
+set
+@major = cast(substring_index(@version_short, '.', 1) as SIGNED);
+set
+@minor = cast(substring_index(@version_short, '.', -1) as SIGNED);
+set
+@engine_stmt = IF((@major >= 5 AND @minor>=6) or @major >= 8, 'SET default_storage_engine=INNODB', 'SET storage_engine=INNODB');

Review Comment:
   I think we shouldn't reformat these also



##########
bigtop-manager-server/src/main/resources/ddl/MySQL-DDL-CREATE.sql:
##########
@@ -22,24 +22,49 @@
 -- DROP DATABASE IF EXISTS `ambari`;
 -- DROP USER `ambari`;
 
-# delimiter ;
+#
+delimiter ;
 
-# CREATE DATABASE `bigtop_manager` /*!40100 DEFAULT CHARACTER SET utf8 */;
+# CREATE
+DATABASE `bigtop_manager` /*!40100 DEFAULT CHARACTER SET utf8 */;
 #
-# CREATE USER 'bigtop_manager' IDENTIFIED BY 'bigdata';
+# CREATE
+USER 'bigtop_manager' IDENTIFIED BY 'bigdata';
 
-# USE @schema;
+#
+USE @schema;

Review Comment:
   New problems here after we reformat these lines



-- 
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: dev-unsubscribe@bigtop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] BIGTOP-4173 : DDL file to create all related tables (MySQL) [bigtop-manager]

Posted by "kevinw66 (via GitHub)" <gi...@apache.org>.
kevinw66 commented on code in PR #27:
URL: https://github.com/apache/bigtop-manager/pull/27#discussion_r1693942562


##########
bigtop-manager-server/src/main/resources/ddl/MySQL-DDL-CREATE.sql:
##########
@@ -58,89 +75,255 @@ CREATE TABLE `user`
     `status`      BIT(1)      DEFAULT 1 COMMENT '0-Disable, 1-Enable',
     `create_time` DATETIME    DEFAULT NULL,
     `update_time` DATETIME    DEFAULT NULL,
+    `create_by`   BIGINT,
+    `update_by`   BIGINT,
     PRIMARY KEY (`id`),
     UNIQUE KEY `uk_username` (`username`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
 
 CREATE TABLE `cluster`
 (
-    `id`           BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-    `cluster_name` VARCHAR(255) DEFAULT NULL COMMENT 'Cluster Name',
-    `cluster_desc` VARCHAR(255) DEFAULT NULL COMMENT 'Cluster Name',
-    `cluster_type` SMALLINT UNSIGNED DEFAULT 1 COMMENT '1-Physical Machine, 2-Kubernetes',
-    `selected`     BIT(1)      DEFAULT 1 COMMENT '0-Disable, 1-Enable',
-    `create_time`  DATETIME     DEFAULT NULL,
-    `update_time`  DATETIME     DEFAULT NULL,
+    `id`            BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+    `cluster_name`  VARCHAR(255) DEFAULT NULL COMMENT 'Cluster Name',
+    `cluster_desc`  VARCHAR(255) DEFAULT NULL COMMENT 'Cluster Name',

Review Comment:
   comment for `cluster_desc` are incorrect



##########
bigtop-manager-server/src/main/resources/application.yml:
##########
@@ -58,7 +58,7 @@ spring:
     show-sql: true
     properties:
       eclipselink:
-        ddl-generation: create-or-extend-tables
+        ddl-generation: create-tables

Review Comment:
   I think this will still auto create tables



-- 
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: dev-unsubscribe@bigtop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] BIGTOP-4173 : DDL file to create all related tables (MySQL) [bigtop-manager]

Posted by "kevinw66 (via GitHub)" <gi...@apache.org>.
kevinw66 commented on PR #27:
URL: https://github.com/apache/bigtop-manager/pull/27#issuecomment-2254836339

   How about we add skip tests on [ci.yml](https://github.com/apache/bigtop-manager/blob/main/.github/workflows/ci.yml)? we can add a separate job to run ut after we have some ut cases


-- 
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: dev-unsubscribe@bigtop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] BIGTOP-4173 : DDL file to create all related tables (MySQL) [bigtop-manager]

Posted by "kevinw66 (via GitHub)" <gi...@apache.org>.
kevinw66 commented on PR #27:
URL: https://github.com/apache/bigtop-manager/pull/27#issuecomment-2254891491

   > I agree with your idea adding SkipTests and unit tests later. but for now, it will be really helpful that CI include build and test.(even just executing server) so I prefer leaving ddl-generation 'create-or-extend-tables' for now.
   
   Sounds good!


-- 
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: dev-unsubscribe@bigtop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org