Source code for tortoise.contrib.mysql.indexes
from typing import Optional, Tuple
from pypika.terms import Term
from tortoise.indexes import Index
[docs]class FullTextIndex(Index):
INDEX_TYPE = "FULLTEXT"
def __init__(
self,
*expressions: Term,
fields: Optional[Tuple[str, ...]] = None,
name: Optional[str] = None,
parser_name: Optional[str] = None,
) -> None:
super().__init__(*expressions, fields=fields, name=name)
if parser_name:
self.extra = f" WITH PARSER {parser_name}"
[docs]class SpatialIndex(Index):
INDEX_TYPE = "SPATIAL"