Mysql 在SQLAlchemy中,如何指定全文索引?
那是我的桌子。如何在全名上建立“全文索引”?(非正常索引)如果您可以在Mysql 在SQLAlchemy中,如何指定全文索引?,mysql,database,indexing,sqlalchemy,Mysql,Database,Indexing,Sqlalchemy,那是我的桌子。如何在全名上建立“全文索引”?(非正常索引)如果您可以在sqlalchemy.schema的index中检查代码,那么他们会写 class AccountIndexes(Base): __tablename__ = 'account_indexes' id = Column(Integer, primary_key = True) user_id = Column(Integer, nullable=False, unique=True, index=Tru
sqlalchemy.schema
的index
中检查代码,那么他们会写
class AccountIndexes(Base):
__tablename__ = 'account_indexes'
id = Column(Integer, primary_key = True)
user_id = Column(Integer, nullable=False, unique=True, index=True)
full_name = Column(String(255), nullable=True)
__table_args__ = {'mysql_engine':'MyISAM'}
现在在
索引的\uuuuu init\uuuuu
中,它们只检查唯一的
。我认为要生成全文索引,您必须使用sqlalchemy的DDL
操作功能。注意:我不需要实际使用查询API。我只需要定义它并创建索引。(反正我使用的是原始SQL)DDL示例:
def __init__(self, name, *columns, **kw):
"""Construct an index object.
:param name:
The name of the index
:param \*columns:
Columns to include in the index. All columns must belong to the same
table.
:param unique:
Defaults to False: create a unique index.
:param \**kw:
Other keyword arguments may be interpreted by specific dialects.
"""
self.table = None
# will call _set_parent() if table-bound column
# objects are present
ColumnCollectionMixin.__init__(self, *columns)
self.name = name
self.unique = kw.pop('unique', False)
self.kwargs = kw