Token indexes
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import logging
|
||||
from typing import TypedDict, Optional, NotRequired
|
||||
|
||||
from sqlalchemy import Index
|
||||
from sqlalchemy.orm import Mapped, mapped_column
|
||||
|
||||
from dexorder.database.column import Address, Blockchain, Uint8
|
||||
@@ -39,10 +40,14 @@ class Token (Base):
|
||||
chain: Mapped[Blockchain] = mapped_column(primary_key=True)
|
||||
address: Mapped[Address] = mapped_column(primary_key=True)
|
||||
name: Mapped[str]
|
||||
symbol: Mapped[str]
|
||||
symbol: Mapped[str] = mapped_column(index=True)
|
||||
decimals: Mapped[Uint8]
|
||||
approved: Mapped[bool] = mapped_column(index=True)
|
||||
|
||||
__table_args__ = (
|
||||
Index('idx_name', 'name', postgresql_using='gist'), # full text search on name
|
||||
)
|
||||
|
||||
|
||||
@staticmethod
|
||||
def load(token_dict: OldTokenDict) -> 'Token':
|
||||
|
||||
Reference in New Issue
Block a user