From fc50ffdb71c0e5496a4bb4e14268d13efd4a506a Mon Sep 17 00:00:00 2001 From: rrr-marble Date: Mon, 7 Mar 2022 20:53:54 +0300 Subject: [PATCH] fix: declarative search index --- src/models.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/models.py b/src/models.py index 07cc0c4..acfe1fc 100644 --- a/src/models.py +++ b/src/models.py @@ -52,6 +52,5 @@ class Item(ItemBase): Computed("to_tsvector('russian', geodata.description)", persisted=True), ) - __table_args__ = Index( - "geodata_search_idx", geodata_search_ts, postgresql_using="gin" - ) + +Index("geodata_search_idx", Item.geodata_search_ts, postgresql_using="gin")