
import django.contrib.gis.db.models.fields
from django.db import migrations


class Migration(migrations.Migration):

    dependencies = [
        ("councils", "0004_auto_20200203_1040"),
    ]

    operations = [
        migrations.AlterField(
            model_name="council",
            name="area",
            field=django.contrib.gis.db.models.fields.MultiPolygonField(
                blank=True, null=True, srid=4326
            ),
        ),
    ]


from django.db import migrations


class Migration(migrations.Migration):

    dependencies = [
        ("councils", "0004_auto_20200203_1040"),
    ]

    operations = [
        migrations.RunSQL(
            'ALTER TABLE "councils_council" ALTER COLUMN "area" TYPE geometry(MULTIPOLYGON,4326) USING area::geometry(MultiPolygon,4326);'
        )
    ]

Fix council migration using explicit type cast
Fix council migration using explicit type cast

The generated SQL for this doesn't include the 'USING' section. It seems
like this is now needed.

  
- import django.contrib.gis.db.models.fields
  from django.db import migrations
  
  
  class Migration(migrations.Migration):
  
      dependencies = [
          ("councils", "0004_auto_20200203_1040"),
      ]
  
      operations = [
+         migrations.RunSQL(
+             'ALTER TABLE "councils_council" ALTER COLUMN "area" TYPE geometry(MULTIPOLYGON,4326) USING area::geometry(MultiPolygon,4326);'
-         migrations.AlterField(
-             model_name="council",
-             name="area",
-             field=django.contrib.gis.db.models.fields.MultiPolygonField(
-                 blank=True, null=True, srid=4326
-             ),
-         ),
+         )
      ]
  
Fix council migration using explicit type cast
## Code Before:

import django.contrib.gis.db.models.fields
from django.db import migrations


class Migration(migrations.Migration):

    dependencies = [
        ("councils", "0004_auto_20200203_1040"),
    ]

    operations = [
        migrations.AlterField(
            model_name="council",
            name="area",
            field=django.contrib.gis.db.models.fields.MultiPolygonField(
                blank=True, null=True, srid=4326
            ),
        ),
    ]

## Instruction:
Fix council migration using explicit type cast
## Code After:

from django.db import migrations


class Migration(migrations.Migration):

    dependencies = [
        ("councils", "0004_auto_20200203_1040"),
    ]

    operations = [
        migrations.RunSQL(
            'ALTER TABLE "councils_council" ALTER COLUMN "area" TYPE geometry(MULTIPOLYGON,4326) USING area::geometry(MultiPolygon,4326);'
        )
    ]
