From b76bfe35c76084f17a7c017192049b793f70b9b1 Mon Sep 17 00:00:00 2001 From: Tomasz Maczukin Date: Mon, 18 Jan 2016 14:13:21 +0100 Subject: Add limit change for 'data' column in 'events' when using MySQL --- db/migrate/limits_to_mysql.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/db/migrate/limits_to_mysql.rb b/db/migrate/limits_to_mysql.rb index 2b7afae6d7c..14d7e84d856 100644 --- a/db/migrate/limits_to_mysql.rb +++ b/db/migrate/limits_to_mysql.rb @@ -6,5 +6,6 @@ class LimitsToMysql < ActiveRecord::Migration change_column :merge_request_diffs, :st_diffs, :text, limit: 2147483647 change_column :snippets, :content, :text, limit: 2147483647 change_column :notes, :st_diff, :text, limit: 2147483647 + change_column :events, :data, :text, limit: 2147483647 end end -- cgit v1.2.1 From d1c474ae6aa98e281cdc46da183a0c29a324ba31 Mon Sep 17 00:00:00 2001 From: Tomasz Maczukin Date: Mon, 18 Jan 2016 15:52:26 +0100 Subject: Add information about PostgreSQL<>MySQL 'text' type differences into to installation docs --- doc/install/database_mysql.md | 19 +++++++++++++++++++ doc/update/README.md | 1 + 2 files changed, 20 insertions(+) diff --git a/doc/install/database_mysql.md b/doc/install/database_mysql.md index 513ad69ec26..4a2c699129d 100644 --- a/doc/install/database_mysql.md +++ b/doc/install/database_mysql.md @@ -52,3 +52,22 @@ We do not recommend using MySQL due to various issues. For example, case [(in)se mysql> \q # You are done installing the database and can go back to the rest of the installation. + +## MySQL strings limits + +After installation or upgrade is done, remember to run `add_limits_mysql` rake task: + +``` +bundle exec rake add_limits_mysql +``` + +The `text` type in MySQL have different size limit than `text` type in PostgreSQL. In MySQL `text` columns are limited +to ~65kB, where in PostgreSQL `text` columns are limited up to ~1GB! + +`add_limits_mysql` rake task converts some important `text` columns in GitLab database to `longtext` which can persist +up to 4GB characters (may be less if the value contains multibyte characters). + +Details can be found in [PostgreSQL manual][postgres-text-type] and in [MySQL manual][mysql-text-types]. + +[postgres-text-type]: http://www.postgresql.org/docs/9.1/static/datatype-character.html +[mysql-text-types]: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html diff --git a/doc/update/README.md b/doc/update/README.md index 0472537eeb5..46aec4885e2 100644 --- a/doc/update/README.md +++ b/doc/update/README.md @@ -14,3 +14,4 @@ Depending on the installation method and your GitLab version, there are multiple ## Miscellaneous - [MySQL to PostgreSQL](mysql_to_postgresql.md) guides you through migrating your database from MySQL to PostgreSQL. +- [MySQL installation guide](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/database_mysql.md) contains additional informations about configuring GitLab to work with MySQL database. -- cgit v1.2.1 From f386a4bd158964a70c6a68531d75cdc74bd32881 Mon Sep 17 00:00:00 2001 From: Tomasz Maczukin Date: Mon, 18 Jan 2016 15:54:16 +0100 Subject: Update CHANGELOG --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 18ccd56dec9..7f1ce169389 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -64,6 +64,7 @@ v 8.4.0 (unreleased) - Remove leading comma on award emoji when the user is the first to award the emoji (Zeger-Jan van de Weg) - Add build artifacts browser - Improve UX in builds artifacts browser + - Add MySQL limit migration for `data` column in `events` table v 8.3.4 - Use gitlab-workhorse 0.5.4 (fixes API routing bug) -- cgit v1.2.1 From a7daf33bc5d33d496456adb017b55094b917e718 Mon Sep 17 00:00:00 2001 From: Tomasz Maczukin Date: Mon, 18 Jan 2016 19:10:16 +0100 Subject: Modify CHANGELOG entry [ci skip] --- CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 7f1ce169389..d1b5bef6b3d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -64,7 +64,7 @@ v 8.4.0 (unreleased) - Remove leading comma on award emoji when the user is the first to award the emoji (Zeger-Jan van de Weg) - Add build artifacts browser - Improve UX in builds artifacts browser - - Add MySQL limit migration for `data` column in `events` table + - Change type of `data` column in `events` table when using MySQL v 8.3.4 - Use gitlab-workhorse 0.5.4 (fixes API routing bug) -- cgit v1.2.1 From 402feec6ddd96880921ad37a931db7c96fd48be0 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Mon, 18 Jan 2016 16:53:33 -0500 Subject: Update MySQL docs [ci skip] --- CHANGELOG | 2 +- doc/install/database_mysql.md | 19 +++++++++++-------- doc/update/README.md | 2 +- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index d1b5bef6b3d..9e9d66fb7f0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -64,7 +64,7 @@ v 8.4.0 (unreleased) - Remove leading comma on award emoji when the user is the first to award the emoji (Zeger-Jan van de Weg) - Add build artifacts browser - Improve UX in builds artifacts browser - - Change type of `data` column in `events` table when using MySQL + - Increase default size of `data` column in `events` table when using MySQL v 8.3.4 - Use gitlab-workhorse 0.5.4 (fixes API routing bug) diff --git a/doc/install/database_mysql.md b/doc/install/database_mysql.md index 4a2c699129d..e51ff5a5de2 100644 --- a/doc/install/database_mysql.md +++ b/doc/install/database_mysql.md @@ -8,7 +8,7 @@ We do not recommend using MySQL due to various issues. For example, case [(in)se # Install the database packages sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev - + # Ensure you have MySQL version 5.5.14 or later mysql --version @@ -31,7 +31,7 @@ We do not recommend using MySQL due to various issues. For example, case [(in)se # Ensure you can use the InnoDB engine which is necessary to support long indexes # If this fails, check your MySQL config files (e.g. `/etc/mysql/*.cnf`, `/etc/mysql/conf.d/*`) for the setting "innodb = off" mysql> SET storage_engine=INNODB; - + # Create the GitLab production database mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`; @@ -55,19 +55,22 @@ We do not recommend using MySQL due to various issues. For example, case [(in)se ## MySQL strings limits -After installation or upgrade is done, remember to run `add_limits_mysql` rake task: +After installation or upgrade, remember to run the `add_limits_mysql` Rake task: ``` bundle exec rake add_limits_mysql ``` -The `text` type in MySQL have different size limit than `text` type in PostgreSQL. In MySQL `text` columns are limited -to ~65kB, where in PostgreSQL `text` columns are limited up to ~1GB! +The `text` type in MySQL has a different size limit than the `text` type in +PostgreSQL. In MySQL `text` columns are limited to ~65kB, whereas in PostgreSQL +`text` columns are limited up to ~1GB! -`add_limits_mysql` rake task converts some important `text` columns in GitLab database to `longtext` which can persist -up to 4GB characters (may be less if the value contains multibyte characters). +The `add_limits_mysql` Rake task converts some important `text` columns in the +GitLab database to `longtext` columns, which can persist values of up to 4GB +(sometimes less if the value contains multibyte characters). -Details can be found in [PostgreSQL manual][postgres-text-type] and in [MySQL manual][mysql-text-types]. +Details can be found in the [PostgreSQL][postgres-text-type] and +[MySQL][mysql-text-types] manuals. [postgres-text-type]: http://www.postgresql.org/docs/9.1/static/datatype-character.html [mysql-text-types]: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html diff --git a/doc/update/README.md b/doc/update/README.md index 46aec4885e2..109d5de3fa2 100644 --- a/doc/update/README.md +++ b/doc/update/README.md @@ -14,4 +14,4 @@ Depending on the installation method and your GitLab version, there are multiple ## Miscellaneous - [MySQL to PostgreSQL](mysql_to_postgresql.md) guides you through migrating your database from MySQL to PostgreSQL. -- [MySQL installation guide](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/database_mysql.md) contains additional informations about configuring GitLab to work with MySQL database. +- [MySQL installation guide](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/database_mysql.md) contains additional information about configuring GitLab to work with a MySQL database. -- cgit v1.2.1