1abb73e39e
Creation of the account_patch_reviews table failed on mysql with the file_name column being set to varchar(4096), see [1]. mysql has a limit of 767 bytes max key length for InnoDb tables. The max key length limit applies to each column in the (primary key) index. MySql uses up to 3 bytes per character when utf8 character set is used. Therefore, the max length of the file_name column is 255 characgters when using utf8 character set. This change sets the file_name column length to 255 when using mysql. The whole "CREATE TABLE ..." statement is extracted into the MysqlAccountPatchReviewStore subclass. This gives more freedom for further mysql specific tuning. Change-Id: If35aff6c8dc515228c770729bfbf3a83e3dcc6bf
73 lines
2.0 KiB
Plaintext
73 lines
2.0 KiB
Plaintext
= MigrateAccountPatchReviewDb
|
|
|
|
== NAME
|
|
MigrateAccountPatchReviewDb - Migrates AccountPatchReviewDb from one database
|
|
backend to another.
|
|
|
|
== SYNOPSIS
|
|
[verse]
|
|
--
|
|
_java_ -jar gerrit.war MigrateAccountPatchReviewDb
|
|
-d <SITE_PATH>
|
|
[--sourceUrl] [--chunkSize]
|
|
--
|
|
|
|
== DESCRIPTION
|
|
Migrates AccountPatchReviewDb from one database backend to another. The
|
|
AccountPatchReviewDb is a database used to store the user file reviewed flags.
|
|
|
|
This command is only intended to be run if the configuration parameter
|
|
link:config-gerrit.html#accountPatchReviewDb.url[accountPatchReviewDb.url]
|
|
is set or changed.
|
|
|
|
To migrate AccountPatchReviewDb:
|
|
|
|
* Stop Gerrit
|
|
* Configure new value for link:config-gerrit.html#accountPatchReviewDb.url[accountPatchReviewDb.url]
|
|
* Migrate data using this command
|
|
* Start Gerrit
|
|
|
|
[NOTE]
|
|
When using MySQL, the file_name column length in the account_patch_reviews table will be shortened
|
|
from the standard 4096 characters down to 255 characters. This is due to a
|
|
link:https://dev.mysql.com/doc/refman/5.7/en/innodb-restrictions.html[MySQL limitation]
|
|
on the max size of 767 bytes for each column in an index.
|
|
|
|
== OPTIONS
|
|
|
|
-d::
|
|
--site-path::
|
|
Location of the `gerrit.config` file, and all other per-site
|
|
configuration data, supporting libraries and log files.
|
|
|
|
--sourceUrl::
|
|
Url of source database. Only need to be specified if the source is not H2.
|
|
|
|
--chunkSize::
|
|
Chunk size of fetching from source and pushing to target on each time.
|
|
Defaults to 100000.
|
|
|
|
== CONTEXT
|
|
This command can only be run on a server which has direct
|
|
connectivity to the database.
|
|
|
|
== EXAMPLES
|
|
To migrate from H2 to the database specified by
|
|
link:config-gerrit.html#accountPatchReviewDb.url[accountPatchReviewDb.url]
|
|
in gerrit.config:
|
|
|
|
----
|
|
$ java -jar gerrit.war MigrateAccountPatchReviewDb -d site_path
|
|
----
|
|
|
|
== SEE ALSO
|
|
|
|
* Configuration parameter link:config-gerrit.html#accountPatchReviewDb.url[accountPatchReviewDb.url]
|
|
|
|
GERRIT
|
|
------
|
|
Part of link:index.html[Gerrit Code Review]
|
|
|
|
SEARCHBOX
|
|
---------
|