mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-26 21:39:43 +02:00
add index on public_share_enabled
This commit is contained in:
parent
036104e4c8
commit
a627cc709e
1 changed files with 12 additions and 0 deletions
|
|
@ -49,9 +49,21 @@ def upgrade() -> None:
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Add partial index on public_share_enabled for fast public chat queries
|
||||||
|
op.execute(
|
||||||
|
"""
|
||||||
|
CREATE INDEX ix_new_chat_threads_public_share_enabled
|
||||||
|
ON new_chat_threads(public_share_enabled)
|
||||||
|
WHERE public_share_enabled = TRUE
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def downgrade() -> None:
|
def downgrade() -> None:
|
||||||
"""Remove public sharing columns from new_chat_threads."""
|
"""Remove public sharing columns from new_chat_threads."""
|
||||||
|
op.drop_index(
|
||||||
|
"ix_new_chat_threads_public_share_enabled", table_name="new_chat_threads"
|
||||||
|
)
|
||||||
op.drop_index(
|
op.drop_index(
|
||||||
"ix_new_chat_threads_public_share_token", table_name="new_chat_threads"
|
"ix_new_chat_threads_public_share_token", table_name="new_chat_threads"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue