Merge "Use charset=utf8mb4 in pymysql DBURIs"

This commit is contained in:
Zuul 2018-04-18 20:56:29 +00:00 committed by Gerrit Code Review
commit 787b52d4e9
5 changed files with 9 additions and 10 deletions

View File

@ -69,7 +69,7 @@ Installing and Upgrading the API server
5. Edit ``./etc/storyboard.conf`` and in the ``oauth`` section, add your IP
Adress to the list of ``valid_oauth_clients``. Then in the ``database``
section, on the line which reads
``# connection = mysql+pymysql://root:pass@127.0.0.1:3306/storyboard``,
``# connection = mysql+pymysql://root:pass@127.0.0.1:3306/storyboard?charset=utf8mb4``,
replace the ``pass`` with your password (the same as used in the above
steps). On both of these lines you will need to remove the ``#``.

View File

@ -116,7 +116,7 @@ lock_path = $state_path/lock
[database]
# This line MUST be changed to actually run storyboard
# Example:
# connection = mysql+pymysql://root:pass@127.0.0.1:3306/storyboard
# connection = mysql+pymysql://root:pass@127.0.0.1:3306/storyboard?charset=utf8mb4
# Replace 127.0.0.1 above with the IP address of the database used by the
# main storyboard server. (Leave it as is if the database runs on this host.)
# connection=sqlite://

View File

@ -9,4 +9,4 @@
lock_path = $state_path/lock
[database]
connection = mysql+pymysql://#DB_USER#:#DB_PASSWORD#@127.0.0.1:3306/#DB_TEST#
connection = mysql+pymysql://#DB_USER#:#DB_PASSWORD#@127.0.0.1:3306/#DB_TEST#?charset=utf8mb4

View File

@ -146,11 +146,10 @@ class DbTestCase(WorkingDirTestCase):
self.db_name = "storyboard_test_db_%s" % uuid.uuid4()
self.db_name = self.db_name.replace("-", "_")
CONF.set_override(
"connection",
self.test_connection + "/%s"
% self.db_name,
group="database")
dburi = self.test_connection + "/%s" % self.db_name
if dburi.startswith('mysql+pymysql://'):
dburi += "?charset=utf8mb4"
CONF.set_override("connection", dburi, group="database")
self._full_db_name = self.test_connection + '/' + self.db_name
LOG.info('using database %s', CONF.database.connection)

View File

@ -6,7 +6,7 @@
#sqlite=sqlite://
#sqlitefile=sqlite:///test_migrations_utils.db
mysql=mysql+pymysql://storyboard:storyboard@localhost/test_migrations_utils
mysql=mysql+pymysql://storyboard:storyboard@localhost/test_migrations_utils?charset=utf8mb4
[migration_dbs]
# Migration DB details are listed separately as they can't be connected to
@ -17,7 +17,7 @@ mysql=mysql+pymysql://storyboard:storyboard@localhost/test_migrations_utils
#sqlite=sqlite://
#sqlitefile=sqlite:///test_migrations.db
#mysql=mysql+pymysql://user:pass@localhost/test_migrations
#mysql=mysql+pymysql://user:pass@localhost/test_migrations?charset=utf8mb4
[walk_style]
snake_walk=yes