diff options
author | Marin Jankovski <marin@gitlab.com> | 2014-02-20 12:18:22 +0000 |
---|---|---|
committer | Marin Jankovski <marin@gitlab.com> | 2014-02-20 12:18:22 +0000 |
commit | e8466a21ca880b0ecc2682177d07234f6f3725f6 (patch) | |
tree | 581023a97a2bb30b0040ba21dce51bc1c4bd2163 | |
parent | 0f080a94106904c57cfcb6c1d02c6207c1d4617e (diff) | |
parent | fcdcb1a6751354819410444ae7f38391e64a686d (diff) | |
download | gitlab-ce-e8466a21ca880b0ecc2682177d07234f6f3725f6.tar.gz |
Merge branch 'case_sensitivity' into 'master'
Case Sensitivity for MYSQL
#1014
-rw-r--r-- | app/models/namespace.rb | 2 | ||||
-rw-r--r-- | app/models/user.rb | 2 | ||||
-rw-r--r-- | doc/install/database_mysql.md (renamed from doc/install/databases.md) | 30 | ||||
-rw-r--r-- | doc/install/installation.md | 20 |
4 files changed, 23 insertions, 31 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb index d5b98f588e8..0bc5e1862eb 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -27,7 +27,7 @@ class Namespace < ActiveRecord::Base format: { with: Gitlab::Regex.name_regex, message: "only letters, digits, spaces & '_' '-' '.' allowed." } validates :description, length: { within: 0..255 } - validates :path, uniqueness: true, presence: true, length: { within: 1..255 }, + validates :path, uniqueness: { case_sensitive: false }, presence: true, length: { within: 1..255 }, exclusion: { in: Gitlab::Blacklist.path }, format: { with: Gitlab::Regex.path_regex, message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" } diff --git a/app/models/user.rb b/app/models/user.rb index dd59f67ea3d..855fe58ffe8 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -109,7 +109,7 @@ class User < ActiveRecord::Base validates :bio, length: { maximum: 255 }, allow_blank: true validates :extern_uid, allow_blank: true, uniqueness: {scope: :provider} validates :projects_limit, presence: true, numericality: {greater_than_or_equal_to: 0} - validates :username, presence: true, uniqueness: true, + validates :username, presence: true, uniqueness: { case_sensitive: false }, exclusion: { in: Gitlab::Blacklist.path }, format: { with: Gitlab::Regex.username_regex, message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" } diff --git a/doc/install/databases.md b/doc/install/database_mysql.md index 481a698a8c8..4cf9b94c1a0 100644 --- a/doc/install/databases.md +++ b/doc/install/database_mysql.md @@ -1,10 +1,6 @@ -# Setup Database - -GitLab supports the following databases: - -* MySQL (preferred) -* PostgreSQL +## Note +We do not recommend using MySQL due to various issues. For example, case [(in)sensitivity](https://dev.mysql.com/doc/refman/5.0/en/case-sensitivity.html) and [problems](http://bugs.mysql.com/bug.php?id=65830) that [suggested](http://bugs.mysql.com/bug.php?id=50909) [fixes](http://bugs.mysql.com/bug.php?id=65830) [have](http://bugs.mysql.com/bug.php?id=63164). ## MySQL @@ -47,25 +43,3 @@ GitLab supports the following databases: mysql> \q # You are done installing the database and can go back to the rest of the installation. - - -## PostgreSQL - - # Install the database packages - sudo apt-get install -y postgresql-9.1 postgresql-client libpq-dev - - # Login to PostgreSQL - sudo -u postgres psql -d template1 - - # Create a user for GitLab. - template1=# CREATE USER git; - - # Create the GitLab production database & grant all privileges on database - template1=# CREATE DATABASE gitlabhq_production OWNER git; - - # Quit the database session - template1=# \q - - # Try connecting to the new database with the new user - sudo -u git -H psql -d gitlabhq_production - diff --git a/doc/install/installation.md b/doc/install/installation.md index dd391eeb4b3..44d57b97efb 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -144,7 +144,25 @@ GitLab Shell is an ssh access and repository management software developed speci # 5. Database -To setup the MySQL/PostgreSQL database and dependencies please see [doc/install/databases.md](./databases.md). +We recommend using a PostgreSQL database. For MySQL check [MySQL setup guide](doc/install/database_mysql.md). + + # Install the database packages + sudo apt-get install -y postgresql-9.1 postgresql-client libpq-dev + + # Login to PostgreSQL + sudo -u postgres psql -d template1 + + # Create a user for GitLab. + template1=# CREATE USER git; + + # Create the GitLab production database & grant all privileges on database + template1=# CREATE DATABASE gitlabhq_production OWNER git; + + # Quit the database session + template1=# \q + + # Try connecting to the new database with the new user + sudo -u git -H psql -d gitlabhq_production # 6. GitLab |