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

Commit

Permalink
upgrades: InnoDB upgrade fix
Browse files Browse the repository at this point in the history
* FIX Runs the sql statement which actually changes the engine from
  MyISAM to InnoDB.

Signed-off-by: Esteban J. G. Gabancho <esteban.gabancho@gmail.com>
  • Loading branch information
egabancho committed Sep 18, 2015
1 parent 70e269f commit 8038ed8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion invenio_upgrader/upgrades/invenio_2015_07_14_innodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@ def do_upgrade():
"""Carry out the upgrade."""
from flask import current_app
if current_app.config.get('CFG_DATABASE_TYPE') == 'mysql':
run_sql(
rows = run_sql(
"SELECT CONCAT('ALTER TABLE ',TABLE_NAME,' ENGINE=InnoDB;')"
" FROM INFORMATION_SCHEMA.TABLES"
" WHERE ENGINE='MyISAM'"
" AND table_schema = %s",
(current_app.config.get('CFG_DATABASE_NAME'),)
)
[run_sql(row[0]) for row in rows]


def estimate():
Expand Down

0 comments on commit 8038ed8

Please sign in to comment.