diff options
author | Luca Milanesio <luca.milanesio@gmail.com> | 2021-03-26 08:55:04 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-03-26 08:55:04 +0000 |
commit | 6e730e197ea0d383ce37200b5507e4427e81a5f1 (patch) | |
tree | 8a396b6df7a554d24c4ce08629af669f427271cc | |
parent | 09467ace1eaef0265d9dc4d81b093b989c4768cd (diff) | |
parent | 1e9537265cbc3a0e6c9941fc1af20c5af9a70fe3 (diff) |
Merge "AccountPatchReview mariadb: fix key length" into stable-3.1
-rw-r--r-- | java/com/google/gerrit/server/schema/MariaDBAccountPatchReviewStore.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/java/com/google/gerrit/server/schema/MariaDBAccountPatchReviewStore.java b/java/com/google/gerrit/server/schema/MariaDBAccountPatchReviewStore.java index b0a3370fe1..dd82be2159 100644 --- a/java/com/google/gerrit/server/schema/MariaDBAccountPatchReviewStore.java +++ b/java/com/google/gerrit/server/schema/MariaDBAccountPatchReviewStore.java @@ -22,6 +22,7 @@ import com.google.gerrit.server.config.ThreadSettingsConfig; import com.google.inject.Inject; import com.google.inject.Singleton; import java.sql.SQLException; +import java.sql.Statement; import org.eclipse.jgit.lib.Config; @Singleton @@ -50,4 +51,17 @@ public class MariaDBAccountPatchReviewStore extends JdbcAccountPatchReviewStore return new StorageException(op + " failure on ACCOUNT_PATCH_REVIEWS", err); } } + + @Override + protected void doCreateTable(Statement stmt) throws SQLException { + stmt.executeUpdate( + "CREATE TABLE IF NOT EXISTS account_patch_reviews (" + + "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, " + + "CONSTRAINT primary_key_account_patch_reviews " + + "PRIMARY KEY (change_id, patch_set_id, account_id, file_name)" + + ")"); + } } |