# Copyright © Michal Čihař <michal@weblate.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later

# Generated by Django 4.1.3 on 2022-12-12 10:40

from django.db import migrations


def rename_index(apps, schema_editor):
    if schema_editor.connection.vendor != "postgresql":
        return
    schema_editor.execute(
        "ALTER INDEX memory_source_trgm_tmp RENAME TO memory_source_trgm"
    )


class Migration(migrations.Migration):
    dependencies = [
        ("memory", "0013_reindex"),
    ]

    operations = [
        migrations.RunPython(
            rename_index, migrations.RunPython.noop, elidable=False, atomic=False
        )
    ]
