Download backend/src/migrations/sql/20261029_0001_upload_idempotency.sql from new-arc/vector: direct link, hf CLI and curl.
- Browser
- Download file 847 Bytes
-
https://huggingface.co/spaces/new-arc/vector/resolve/main/backend/src/migrations/sql/20261029_0001_upload_idempotency.sql
- Command line
-
hf download hf://spaces/new-arc/vector/backend/src/migrations/sql/20261029_0001_upload_idempotency.sql
-
curl -L -o 20261029_0001_upload_idempotency.sql https://huggingface.co/spaces/new-arc/vector/resolve/main/backend/src/migrations/sql/20261029_0001_upload_idempotency.sql
847 Bytes
| -- Direct uploads remember a content hash so a retry of the same file reuses | |
| -- the stored object. The remote copy, when object storage is on, is recorded | |
| -- after the HTTP response so the request does not wait for it. | |
| ALTER TABLE media_upload_sessions ADD COLUMN IF NOT EXISTS content_sha256 TEXT; | |
| ALTER TABLE media_upload_sessions ADD COLUMN IF NOT EXISTS idempotency_key TEXT; | |
| ALTER TABLE media_upload_sessions ADD COLUMN IF NOT EXISTS storage_reference TEXT; | |
| CREATE UNIQUE INDEX IF NOT EXISTS media_upload_sessions_content_hash_idx | |
| ON media_upload_sessions (user_id, content_sha256) | |
| WHERE content_sha256 IS NOT NULL AND state = 'completed'; | |
| CREATE UNIQUE INDEX IF NOT EXISTS media_upload_sessions_idempotency_idx | |
| ON media_upload_sessions (user_id, idempotency_key) | |
| WHERE idempotency_key IS NOT NULL AND state = 'completed'; | |