
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('publishers', '0007_publisher_romeo_parent_id'),
    ]

    operations = [
        migrations.AlterField(
            model_name='journal',
            name='title',
            field=models.CharField(max_length=256),
        ),
        migrations.AlterField(
            model_name='publisher',
            name='name',
            field=models.CharField(max_length=256),
        ),
        migrations.RunSQL(
            sql="""
            CREATE INDEX CONCURRENTLY papers_journal_title_upper ON public.papers_journal USING btree (UPPER(title));
            """,
            reverse_sql="""
            DROP INDEX CONCURRENTLY papers_journal_title_upper;
            """
        ),
        migrations.RunSQL(
            sql="""
            CREATE INDEX CONCURRENTLY papers_publisher_name_upper ON public.papers_publisher USING btree (UPPER(name));
            """,
            reverse_sql="""
            DROP INDEX CONCURRENTLY papers_publisher_name_upper;
            """
        ),

    ]


from django.db import migrations, models


class Migration(migrations.Migration):
    atomic = False

    dependencies = [
        ('publishers', '0007_publisher_romeo_parent_id'),
    ]

    operations = [
        migrations.AlterField(
            model_name='journal',
            name='title',
            field=models.CharField(max_length=256),
        ),
        migrations.AlterField(
            model_name='publisher',
            name='name',
            field=models.CharField(max_length=256),
        ),
        migrations.RunSQL(
            sql="""
            CREATE INDEX CONCURRENTLY papers_journal_title_upper ON public.papers_journal USING btree (UPPER(title));
            """,
            reverse_sql="""
            DROP INDEX CONCURRENTLY papers_journal_title_upper;
            """,
        ),
        migrations.RunSQL(
            sql="""
            CREATE INDEX CONCURRENTLY papers_publisher_name_upper ON public.papers_publisher USING btree (UPPER(name));
            """,
            reverse_sql="""
            DROP INDEX CONCURRENTLY papers_publisher_name_upper;
            """
        ),

    ]

Mark index migration as non atomic
Mark index migration as non atomic

  
  from django.db import migrations, models
  
  
  class Migration(migrations.Migration):
+     atomic = False
  
      dependencies = [
          ('publishers', '0007_publisher_romeo_parent_id'),
      ]
  
      operations = [
          migrations.AlterField(
              model_name='journal',
              name='title',
              field=models.CharField(max_length=256),
          ),
          migrations.AlterField(
              model_name='publisher',
              name='name',
              field=models.CharField(max_length=256),
          ),
          migrations.RunSQL(
              sql="""
              CREATE INDEX CONCURRENTLY papers_journal_title_upper ON public.papers_journal USING btree (UPPER(title));
              """,
              reverse_sql="""
              DROP INDEX CONCURRENTLY papers_journal_title_upper;
-             """
+             """,
          ),
          migrations.RunSQL(
              sql="""
              CREATE INDEX CONCURRENTLY papers_publisher_name_upper ON public.papers_publisher USING btree (UPPER(name));
              """,
              reverse_sql="""
              DROP INDEX CONCURRENTLY papers_publisher_name_upper;
              """
          ),
  
      ]
  
Mark index migration as non atomic
## Code Before:

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('publishers', '0007_publisher_romeo_parent_id'),
    ]

    operations = [
        migrations.AlterField(
            model_name='journal',
            name='title',
            field=models.CharField(max_length=256),
        ),
        migrations.AlterField(
            model_name='publisher',
            name='name',
            field=models.CharField(max_length=256),
        ),
        migrations.RunSQL(
            sql="""
            CREATE INDEX CONCURRENTLY papers_journal_title_upper ON public.papers_journal USING btree (UPPER(title));
            """,
            reverse_sql="""
            DROP INDEX CONCURRENTLY papers_journal_title_upper;
            """
        ),
        migrations.RunSQL(
            sql="""
            CREATE INDEX CONCURRENTLY papers_publisher_name_upper ON public.papers_publisher USING btree (UPPER(name));
            """,
            reverse_sql="""
            DROP INDEX CONCURRENTLY papers_publisher_name_upper;
            """
        ),

    ]

## Instruction:
Mark index migration as non atomic
## Code After:

from django.db import migrations, models


class Migration(migrations.Migration):
    atomic = False

    dependencies = [
        ('publishers', '0007_publisher_romeo_parent_id'),
    ]

    operations = [
        migrations.AlterField(
            model_name='journal',
            name='title',
            field=models.CharField(max_length=256),
        ),
        migrations.AlterField(
            model_name='publisher',
            name='name',
            field=models.CharField(max_length=256),
        ),
        migrations.RunSQL(
            sql="""
            CREATE INDEX CONCURRENTLY papers_journal_title_upper ON public.papers_journal USING btree (UPPER(title));
            """,
            reverse_sql="""
            DROP INDEX CONCURRENTLY papers_journal_title_upper;
            """,
        ),
        migrations.RunSQL(
            sql="""
            CREATE INDEX CONCURRENTLY papers_publisher_name_upper ON public.papers_publisher USING btree (UPPER(name));
            """,
            reverse_sql="""
            DROP INDEX CONCURRENTLY papers_publisher_name_upper;
            """
        ),

    ]
