Skip to content

Cannot create database index on foreignkey field #293

@heybuddy

Description

@heybuddy

I'm experiencing the same problem described in this blog post: https://mathieulamiot.com/my-feedbacks-on-using-cockroachdb-for-a-data-intensive-django-service/

Basically, creating a foreignkey field does not create a database index, even if db_index=True is specified. The workaround described above is to make a RunSQL migration to manually create the index for every field, but it would be better to respect the db_index argument.

I am using cockroachdb 22.1.22 and django-cockroachdb==3.2.2.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions