summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Arès <hugo.ares@ericsson.com>2017-04-25 09:10:03 +0200
committerDavid Pursehouse <dpursehouse@collab.net>2017-04-25 09:58:43 +0000
commitb2798269590d5e87912badff9900dc98e8de2531 (patch)
treefc4929055f9e71fc95c13cab2bc3beb8660411ba
parentf3cdd45e9e3bc2361e87ae2542079331e20c93cd (diff)
Fix file_name column size in H2AccountPatchReviewStore
file_name store the path to the file within the repository. Absolute file path on Linux have a maximum of 4096 characters so increase file_name column size to 4096. This fixes only apply to installations that did not yet migrate to 2.13, for existing ones, a manual db migration is required. Manual migration can be done by using H2 web console, Gerrit must be stopped before otherwise H2 console will not be able to connect to database: java -jar /path/to/h2.jar -url jdbc:h2:path/to/review_site/db/account_patch_reviews then execute the following statement: ALTER TABLE account_patch_reviews ALTER COLUMN file_name VARCHAR(4096) DEFAULT '' NOT NULL Depending on the number or rows, this statement can take long time, for example, one million row can take up to 1 minute. Change-Id: I83ab98acb1581c2a7f6c65a9c2159873421f39ea
-rw-r--r--gerrit-server/src/main/java/com/google/gerrit/server/schema/H2AccountPatchReviewStore.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/schema/H2AccountPatchReviewStore.java b/gerrit-server/src/main/java/com/google/gerrit/server/schema/H2AccountPatchReviewStore.java
index b5862f2717..6dbe916768 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/schema/H2AccountPatchReviewStore.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/schema/H2AccountPatchReviewStore.java
@@ -143,7 +143,7 @@ public class H2AccountPatchReviewStore
+ "account_id INTEGER DEFAULT 0 NOT NULL, "
+ "change_id INTEGER DEFAULT 0 NOT NULL, "
+ "patch_set_id INTEGER DEFAULT 0 NOT NULL, "
- + "file_name VARCHAR(255) DEFAULT '' NOT NULL, "
+ + "file_name VARCHAR(4096) DEFAULT '' NOT NULL, "
+ "CONSTRAINT primary_key_account_patch_reviews "
+ "PRIMARY KEY (account_id, change_id, patch_set_id, file_name)"
+ ")");