
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ('signage', '0012_auto_20200406_1411'),
    ]

    operations = [
        migrations.RemoveField(
            model_name='blade',
            name='deleted',
        ),
        migrations.RemoveField(
            model_name='blade',
            name='structure',
        ),
        migrations.RemoveField(
            model_name='line',
            name='structure',
        ),
        migrations.AlterField(
            model_name='line',
            name='blade',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='lines',
                                    to='signage.Blade', verbose_name='Blade'),
        ),
    ]


from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ('signage', '0012_auto_20200406_1411'),
    ]

    operations = [
        migrations.RunSQL(sql=[("DELETE FROM geotrek.signage_blade WHERE deleted=TRUE;", )]),
        migrations.RemoveField(
            model_name='blade',
            name='deleted',
        ),
        migrations.RemoveField(
            model_name='blade',
            name='structure',
        ),
        migrations.RemoveField(
            model_name='line',
            name='structure',
        ),
        migrations.AlterField(
            model_name='line',
            name='blade',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='lines',
                                    to='signage.Blade', verbose_name='Blade'),
        ),
    ]

Remove element with deleted=true before removefield
Remove element with deleted=true before removefield

  
  from django.db import migrations, models
  import django.db.models.deletion
  
  
  class Migration(migrations.Migration):
  
      dependencies = [
          ('signage', '0012_auto_20200406_1411'),
      ]
  
      operations = [
+         migrations.RunSQL(sql=[("DELETE FROM geotrek.signage_blade WHERE deleted=TRUE;", )]),
          migrations.RemoveField(
              model_name='blade',
              name='deleted',
          ),
          migrations.RemoveField(
              model_name='blade',
              name='structure',
          ),
          migrations.RemoveField(
              model_name='line',
              name='structure',
          ),
          migrations.AlterField(
              model_name='line',
              name='blade',
              field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='lines',
                                      to='signage.Blade', verbose_name='Blade'),
          ),
      ]
  
Remove element with deleted=true before removefield
## Code Before:

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ('signage', '0012_auto_20200406_1411'),
    ]

    operations = [
        migrations.RemoveField(
            model_name='blade',
            name='deleted',
        ),
        migrations.RemoveField(
            model_name='blade',
            name='structure',
        ),
        migrations.RemoveField(
            model_name='line',
            name='structure',
        ),
        migrations.AlterField(
            model_name='line',
            name='blade',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='lines',
                                    to='signage.Blade', verbose_name='Blade'),
        ),
    ]

## Instruction:
Remove element with deleted=true before removefield
## Code After:

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ('signage', '0012_auto_20200406_1411'),
    ]

    operations = [
        migrations.RunSQL(sql=[("DELETE FROM geotrek.signage_blade WHERE deleted=TRUE;", )]),
        migrations.RemoveField(
            model_name='blade',
            name='deleted',
        ),
        migrations.RemoveField(
            model_name='blade',
            name='structure',
        ),
        migrations.RemoveField(
            model_name='line',
            name='structure',
        ),
        migrations.AlterField(
            model_name='line',
            name='blade',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='lines',
                                    to='signage.Blade', verbose_name='Blade'),
        ),
    ]
