Skip to content

Commit

Permalink
Put index creation in its own function.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielballan committed Jan 27, 2024
1 parent 30b864c commit f094d24
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tiled/catalog/orm.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,13 @@ def unique_parameter_num_null_check(target, connection, **kw):
EXECUTE FUNCTION raise_if_null_parameter_exists();"""
)
)
# This creates a ts_vector based metadata search index for fulltext.
# Postgres only feature


@event.listens_for(DataSourceAssetAssociation.__table__, "after_create")
def create_index_metadata_tsvector_search(target, connection, **kw):
# This creates a ts_vector based metadata search index for fulltext.
# Postgres only feature
if connection.engine.dialect.name == "postgresql":
connection.execute(
text(
"""
Expand Down

0 comments on commit f094d24

Please sign in to comment.