from __future__ import unicode_literals

from django.db import migrations


class Migration(migrations.Migration):

    dependencies = [
        ('kbadge', '0001_initial'),
    ]

    operations = [
        migrations.RunSQL(
            "UPDATE badger_badge SET image = CONCAT('uploads/', image) WHERE image NOT LIKE 'uploads/%'"
        )
    ]

from __future__ import unicode_literals

from django.db import migrations


class Migration(migrations.Migration):

    dependencies = [
        ('kbadge', '0001_initial'),
    ]

    operations = [
        migrations.RunSQL(
            "UPDATE badger_badge SET image = CONCAT('uploads/', image) WHERE image NOT LIKE 'uploads/%' AND image IS NOT NULL AND image != ''"
        )
    ]

Update SQL data migration to exclude NULL and blank image values.
Update SQL data migration to exclude NULL and blank image values.

  from __future__ import unicode_literals
  
  from django.db import migrations
  
  
  class Migration(migrations.Migration):
  
      dependencies = [
          ('kbadge', '0001_initial'),
      ]
  
      operations = [
          migrations.RunSQL(
-             "UPDATE badger_badge SET image = CONCAT('uploads/', image) WHERE image NOT LIKE 'uploads/%'"
+             "UPDATE badger_badge SET image = CONCAT('uploads/', image) WHERE image NOT LIKE 'uploads/%' AND image IS NOT NULL AND image != ''"
          )
      ]
  
Update SQL data migration to exclude NULL and blank image values.
## Code Before:
from __future__ import unicode_literals

from django.db import migrations


class Migration(migrations.Migration):

    dependencies = [
        ('kbadge', '0001_initial'),
    ]

    operations = [
        migrations.RunSQL(
            "UPDATE badger_badge SET image = CONCAT('uploads/', image) WHERE image NOT LIKE 'uploads/%'"
        )
    ]

## Instruction:
Update SQL data migration to exclude NULL and blank image values.
## Code After:
from __future__ import unicode_literals

from django.db import migrations


class Migration(migrations.Migration):

    dependencies = [
        ('kbadge', '0001_initial'),
    ]

    operations = [
        migrations.RunSQL(
            "UPDATE badger_badge SET image = CONCAT('uploads/', image) WHERE image NOT LIKE 'uploads/%' AND image IS NOT NULL AND image != ''"
        )
    ]
