fix DB migration for MySQL

current version of migration API doesn't allow to
pass several commands to one execute

Depends-On: I9f1f39b30d43dc16a474febcf6549cf1901732ec
Change-Id: I0a74c87c4c782a7a26aa0e67fada994cb3e31434
This commit is contained in:
Andrey Pavlov 2018-01-09 22:03:13 +03:00
parent edc0cae6ed
commit 417b02df65
2 changed files with 4 additions and 3 deletions

View File

@ -242,7 +242,7 @@ function configure_ec2api {
# init_ec2api() - Initialize databases, etc.
function init_ec2api() {
# (re)create ec2api database
recreate_database ec2api utf8
recreate_database ec2api
$EC2API_BIN_DIR/ec2-api-manage --config-file $EC2API_CONF_FILE db_sync
}

View File

@ -48,9 +48,10 @@ def upgrade(migrate_engine):
if migrate_engine.name == "mysql":
# In Folsom we explicitly converted migrate_version to UTF8.
sql = "ALTER TABLE migrate_version CONVERT TO CHARACTER SET utf8;"
migrate_engine.execute(sql)
# Set default DB charset to UTF8.
sql += ("ALTER DATABASE %s DEFAULT CHARACTER SET utf8;" %
migrate_engine.url.database)
sql = (" ALTER DATABASE %s DEFAULT CHARACTER SET utf8;" %
migrate_engine.url.database)
migrate_engine.execute(sql)