mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-05 23:42:21 +00:00
add unique index on public_share_token
This commit is contained in:
parent
b61d96fb85
commit
036104e4c8
1 changed files with 12 additions and 0 deletions
|
|
@ -40,8 +40,20 @@ def upgrade() -> None:
|
|||
),
|
||||
)
|
||||
|
||||
# Add unique partial index on public_share_token (only non-null values)
|
||||
op.execute(
|
||||
"""
|
||||
CREATE UNIQUE INDEX ix_new_chat_threads_public_share_token
|
||||
ON new_chat_threads(public_share_token)
|
||||
WHERE public_share_token IS NOT NULL
|
||||
"""
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
"""Remove public sharing columns from new_chat_threads."""
|
||||
op.drop_index(
|
||||
"ix_new_chat_threads_public_share_token", table_name="new_chat_threads"
|
||||
)
|
||||
op.drop_column("new_chat_threads", "public_share_enabled")
|
||||
op.drop_column("new_chat_threads", "public_share_token")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue