Skip to content

Commit

Permalink
Merge pull request #4 from GovReady/pk-db-character-encoding-20200729
Browse files Browse the repository at this point in the history
add UTF8 encoding instructions for DBs
  • Loading branch information
gregelin committed Jul 31, 2020
2 parents 71e808f + 7454a34 commit 31f7319
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,13 @@ Make a note of the MySQL's host, port, database name, user and password to add t
...
}
For proper operation, ensure that MySQL databases created for GovReady use UTF-8 encoding.

.. code-block:: sql
CREATE DATABASE govready_q
CHARACTER SET utf8mb4
COLLATE utf8mb4_0900_ai_ci;
3 (option c). Installing PostgreSQL
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -179,7 +186,7 @@ Then set up the user and database (both named ``govready_q``):
sudo -iu postgres createuser -P govready_q
# Paste a long random password when prompted
sudo -iu postgres createdb govready_q
sudo -iu postgres createdb --encoding UTF8 --lc-collate 'en_US.UTF-8' --lc-ctype 'en_US.UTF-8' govready_q
Postgres’s default permissions automatically grant users access to a
database of the same name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,13 @@ Make a note of the MySQL's host, port, database name, user and password to add t
...
}
For proper operation, ensure that MySQL databases created for GovReady use UTF-8 encoding.

.. code-block:: sql
CREATE DATABASE govready_q
CHARACTER SET utf8mb4
COLLATE utf8mb4_0900_ai_ci;
3 (option c). Installing PostgreSQL
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -166,7 +173,7 @@ Then set up the user and database (both named ``govready_q``):
sudo -iu postgres createuser -P govready_q
# Paste a long random password when prompted
sudo -iu postgres createdb govready_q
sudo -iu postgres createdb --encoding UTF8 --lc-collate 'en_US.UTF-8' --lc-ctype 'en_US.UTF-8' govready_q
Postgres’s default permissions automatically grant users access to a
database of the same name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ Make a note of the MySQL's host, port, database name, user and password to add t
...
}
For proper operation, ensure that MySQL databases created for GovReady use UTF-8 encoding.

.. code-block:: sql
CREATE DATABASE govready_q
CHARACTER SET utf8mb4
COLLATE utf8mb4_0900_ai_ci;
3 (option c). Installing PostgreSQL
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand All @@ -177,7 +185,7 @@ Then set up the user and database (both named ``govready_q``):
sudo -iu postgres createuser -P govready_q
# Paste a long random password when prompted
sudo -iu postgres createdb govready_q
sudo -iu postgres createdb --encoding UTF8 --lc-collate 'en_US.UTF-8' --lc-ctype 'en_US.UTF-8' govready_q
Postgres’s default permissions automatically grant users access to a
database of the same name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,29 @@ is also supported.
SQLite is supported in development environments, but it is not recommended for
production use.

Character Encoding
------------------

For proper operation, ensure that databases created for GovReady use UTF-8 encoding.

For convenience, we summarize database settings here. Consult your database documentation to ensure you properly set up your database with UTF-8 encoding.

**PostgreSQL**

.. code-block:: sql
CREATE DATABASE "govready_q"
ENCODING 'UTF8'
LC_COLLATE = 'en_US.UTF-8' LC_CTYPE = 'en_US.UTF-8';
**MySQL/MariaDB**

.. code-block:: sql
CREATE DATABASE govready_q
CHARACTER SET utf8mb4
COLLATE utf8mb4_0900_ai_ci;
Setting Up Postgres
-------------------

Expand Down Expand Up @@ -79,7 +102,7 @@ Then set up the user and database (both named ``govready_q``):
sudo -iu postgres createuser -P govready_q
# paste a long random password

sudo -iu postgres createdb govready_q
sudo -iu postgres createdb --encoding UTF8 --lc-collate 'en_US.UTF-8' --lc-ctype 'en_US.UTF-8' govready_q

Postgres’s default permissions automatically grant users access to a
database of the same name.
Expand Down

0 comments on commit 31f7319

Please sign in to comment.