Updated MySQL-specific migration that enables compression to be non-atomic

This commit is contained in:
dvanaken 2019-10-23 16:17:25 -04:00 committed by Dana Van Aken
parent abe439a8e1
commit ec896d01f6
1 changed files with 2 additions and 4 deletions

View File

@ -45,15 +45,11 @@ def compression_supported(schema_editor):
def enable_compression(apps, schema_editor):
# try:
if compression_supported(schema_editor):
for table in TABLES_TO_COMPRESS:
schema_editor.execute(ALTER_SQL % (table, 'zlib'))
schema_editor.execute(OPTIMIZE_SQL % table)
# except ProgrammingError:
# LOG.warning("Error applying forward migration '0002_enable_compression'... Skipping.")
def disable_compression(apps, schema_editor):
try:
@ -68,6 +64,8 @@ def disable_compression(apps, schema_editor):
class Migration(migrations.Migration):
atomic = False
dependencies = [
('website', '0001_initial'),
]