Skip to content
This repository has been archived by the owner on May 3, 2020. It is now read-only.

upgrades: InnoDB upgrade fix #9

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions invenio_upgrader/upgrades/invenio_2015_07_14_innodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@ def do_upgrade():
"""Carry out the upgrade."""
from flask import current_app
if current_app.config.get('CFG_DATABASE_TYPE') == 'mysql':
run_sql(
"SELECT CONCAT('ALTER TABLE ',TABLE_NAME,' ENGINE=InnoDB;')"
table_names = run_sql(
"SELECT TABLE_NAME"
" FROM INFORMATION_SCHEMA.TABLES"
" WHERE ENGINE='MyISAM'"
" AND table_schema = %s",
" AND table_schema=%s",
(current_app.config.get('CFG_DATABASE_NAME'),)
)
for table_name in table_names:
run_sql("ALTER TABLE `%s` ENGINE=InnoDB" % (table_name[0],))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

`

vs.

'

cc @hachreak

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it doesn't make sense to change because actually this query is valid only for mysql.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍



def estimate():
Expand Down