# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2017-06-20 14:26
from __future__ import unicode_literals


from django.db import migrations


def forwards(apps, schema_editor):
    chars_to_replace = (';', ':', '\t', '\n')  # that's all we have in the db
    Company = apps.get_model('company', 'Company')
    for company in Company.objects.all():
        for char_to_replace in chars_to_replace:
            company.keywords = company.keywords.replace(char_to_replace, ',')
            company.save()


class Migration(migrations.Migration):

    dependencies = [
        ('company', '0044_rebuild_elasticserach_index'),
    ]

    operations = [
        migrations.RunPython(forwards, reverse_code=migrations.RunPython.noop)
    ]
