mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-26 21:39:43 +02: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:
|
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_token", table_name="new_chat_threads"
|
||||||
|
)
|
||||||
op.drop_column("new_chat_threads", "public_share_enabled")
|
op.drop_column("new_chat_threads", "public_share_enabled")
|
||||||
op.drop_column("new_chat_threads", "public_share_token")
|
op.drop_column("new_chat_threads", "public_share_token")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue