Skip to content

Migration Error with Django 5.1. Probably due to use of 'AlterIndexTogether'/'index_together' #108

@Beschus

Description

@Beschus

The migration file migrations/0002_auto_20170912_0537.py uses the (in Django 5.1) deprecated 'index_together'

operations = [
        migrations.AlterIndexTogether(
            name='changeset',
            index_together=set([('content_type', 'object_id')]),
        ),
        migrations.AlterIndexTogether(
            name='softdeleterecord',
            index_together=set([('content_type', 'object_id')]),
        ),
    ]

This threw an error regarding index_together when trying to run migrations with softdelete.

I edited the migration file to the following and that solved my problem for now.

operations = [
        migrations.AddIndex('changeset', Index(fields=['content_type','object_id'], name='changeset__content_1')),
        migrations.AddIndex('softdeleterecord', Index(fields=['content_type','object_id'], name='softdelete__content_1')),
    ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions