Skip to content

Commit

Permalink
Integrate btree_gin index type on creation 📥
Browse files Browse the repository at this point in the history
  • Loading branch information
Kezzsim committed Oct 24, 2023
1 parent 7c122f9 commit ea9d24a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions tiled/catalog/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ async def initialize_database(engine):
from . import orm # noqa: F401

async with engine.connect() as connection:
# Install extensions
if (engine.dialect.name == "postgresql"):
await connection.execute(text("create extension btree_gin;"))
# Create all tables.
await connection.run_sync(Base.metadata.create_all)
if engine.dialect.name == "sqlite":
Expand Down
2 changes: 1 addition & 1 deletion tiled/catalog/orm.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class Node(Timestamped, Base):
"time_created",
"id",
"metadata",
postgresql_using="btree",
postgresql_using="gin",
),
# This is used by ORDER BY with the default sorting.
# Index("ancestors_time_created", "ancestors", "time_created"),
Expand Down

0 comments on commit ea9d24a

Please sign in to comment.