1234567891011121314151617181920 |
- from __future__ import unicode_literals
- from django.db import migrations
- class Migration(migrations.Migration):
- """Empty floatfield are stored as empty string by sqlite. But Django hates
- that and refuse to handle it properly until they are stored as NULL."""
- dependencies = [
- ('contribmap', '0001_initial'),
- ]
- float_cols = ['bandwidth', 'share_part', 'floor', 'floor_total']
- operations = [
- migrations.RunSQL(
- "UPDATE contribs SET {col}=NULL WHERE {col}='';".format(col=i))
- for i in float_cols
- ]
|