Skip to content

Add support for defining MySQL FULLTEXT INDEX in the model #314

@edmorley

Description

@edmorley

I originally filed this against Django (https://code.djangoproject.com/ticket/26990) however it was suggested django-mysql might be a better home for now.

In MySQL 5.6 support was added to InnoDB for full text indexes:
https://dev.mysql.com/doc/refman/5.6/en/innodb-fulltext-index.html

Currently we have to create these via a migration like:

migrations.RunSQL(
    sql='CREATE FULLTEXT INDEX `idx_description` on foo(`description`);',
    reverse_sql='ALTER TABLE foo DROP INDEX idx_description',
),

It would be ideal to be able to define them via the model DDL instead, so the full DB state can be recreated from the model.

In the Django ticket it was mentioned this might need to wait until Django 1.11's more formal support for indexes lands:
https://code.djangoproject.com/ticket/26808
django/django#6857

Many thanks!

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