Updated MySQL-specific migration that enables compression to be non-atomic
This commit is contained in:
		
							parent
							
								
									abe439a8e1
								
							
						
					
					
						commit
						ec896d01f6
					
				|  | @ -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'), | ||||
|     ] | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue