from __future__ import unicode_literals

from django.db import migrations, models
from django.db.models import F
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps

def migrate_set_order_value(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
    CustomProfileField = apps.get_model('zerver', 'CustomProfileField')
    CustomProfileField.objects.all().update(order=F('id'))

class Migration(migrations.Migration):

    dependencies = [
        ('zerver', '0166_add_url_to_profile_field'),
    ]

    operations = [
        migrations.AddField(
            model_name='customprofilefield',
            name='order',
            field=models.IntegerField(default=0),
        ),
        migrations.RunPython(migrate_set_order_value),
    ]

from __future__ import unicode_literals

from django.db import migrations, models
from django.db.models import F
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps

def migrate_set_order_value(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
    CustomProfileField = apps.get_model('zerver', 'CustomProfileField')
    CustomProfileField.objects.all().update(order=F('id'))

class Migration(migrations.Migration):

    dependencies = [
        ('zerver', '0166_add_url_to_profile_field'),
    ]

    operations = [
        migrations.AddField(
            model_name='customprofilefield',
            name='order',
            field=models.IntegerField(default=0),
        ),
        migrations.RunPython(migrate_set_order_value,
                             reverse_code=migrations.RunPython.noop),
    ]

Add missing reverse_code for migration 0167.
migrations: Add missing reverse_code for migration 0167.

  from __future__ import unicode_literals
  
  from django.db import migrations, models
  from django.db.models import F
  from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
  from django.db.migrations.state import StateApps
  
  def migrate_set_order_value(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
      CustomProfileField = apps.get_model('zerver', 'CustomProfileField')
      CustomProfileField.objects.all().update(order=F('id'))
  
  class Migration(migrations.Migration):
  
      dependencies = [
          ('zerver', '0166_add_url_to_profile_field'),
      ]
  
      operations = [
          migrations.AddField(
              model_name='customprofilefield',
              name='order',
              field=models.IntegerField(default=0),
          ),
-         migrations.RunPython(migrate_set_order_value),
+         migrations.RunPython(migrate_set_order_value,
+                              reverse_code=migrations.RunPython.noop),
      ]
  
Add missing reverse_code for migration 0167.
## Code Before:
from __future__ import unicode_literals

from django.db import migrations, models
from django.db.models import F
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps

def migrate_set_order_value(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
    CustomProfileField = apps.get_model('zerver', 'CustomProfileField')
    CustomProfileField.objects.all().update(order=F('id'))

class Migration(migrations.Migration):

    dependencies = [
        ('zerver', '0166_add_url_to_profile_field'),
    ]

    operations = [
        migrations.AddField(
            model_name='customprofilefield',
            name='order',
            field=models.IntegerField(default=0),
        ),
        migrations.RunPython(migrate_set_order_value),
    ]

## Instruction:
Add missing reverse_code for migration 0167.
## Code After:
from __future__ import unicode_literals

from django.db import migrations, models
from django.db.models import F
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps

def migrate_set_order_value(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
    CustomProfileField = apps.get_model('zerver', 'CustomProfileField')
    CustomProfileField.objects.all().update(order=F('id'))

class Migration(migrations.Migration):

    dependencies = [
        ('zerver', '0166_add_url_to_profile_field'),
    ]

    operations = [
        migrations.AddField(
            model_name='customprofilefield',
            name='order',
            field=models.IntegerField(default=0),
        ),
        migrations.RunPython(migrate_set_order_value,
                             reverse_code=migrations.RunPython.noop),
    ]
