From 6f4e94ba9ad1dd3a0ab1e142950666417b145eeb Mon Sep 17 00:00:00 2001 From: Naoki Takezoe Date: Tue, 12 Apr 2016 10:06:38 +0900 Subject: [PATCH] Update migration scripts for MySQL compatibility --- .../resources/update/gitbucket-core_4.0.sql | 2 +- .../resources/update/gitbucket-core_4.0.xml | 433 ++++++++++-------- 2 files changed, 249 insertions(+), 186 deletions(-) diff --git a/src/main/resources/update/gitbucket-core_4.0.sql b/src/main/resources/update/gitbucket-core_4.0.sql index 775a77c1c..12b5fcf1d 100644 --- a/src/main/resources/update/gitbucket-core_4.0.sql +++ b/src/main/resources/update/gitbucket-core_4.0.sql @@ -3,7 +3,7 @@ CREATE OR REPLACE VIEW ISSUE_OUTLINE_VIEW AS A.USER_NAME, A.REPOSITORY_NAME, A.ISSUE_ID, - NVL(B.COMMENT_COUNT, 0) + NVL(C.COMMENT_COUNT, 0) AS COMMENT_COUNT + IFNULL(B.COMMENT_COUNT, 0) + IFNULL(C.COMMENT_COUNT, 0) AS COMMENT_COUNT FROM ISSUE A LEFT OUTER JOIN ( SELECT USER_NAME, REPOSITORY_NAME, ISSUE_ID, COUNT(COMMENT_ID) AS COMMENT_COUNT FROM ISSUE_COMMENT diff --git a/src/main/resources/update/gitbucket-core_4.0.xml b/src/main/resources/update/gitbucket-core_4.0.xml index 3fd59f6d7..ed0da7b74 100644 --- a/src/main/resources/update/gitbucket-core_4.0.xml +++ b/src/main/resources/update/gitbucket-core_4.0.xml @@ -1,13 +1,9 @@ - - - - - - - + + + @@ -23,133 +19,25 @@ - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -165,123 +53,298 @@ - - - - - - + + - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - \ No newline at end of file