integrate Vercel Blob (Issue #209)#227
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #209
Summary
file_uploads.file_datanullable and add Blob metadata columns + migration so legacy DB-backed rows still work./api/files/:idreturns a 307 redirect to the Blob URL when present.Schema / Migration (Required)
file_uploads.file_datais now nullable and new columns were added (storage_provider,storage_url,storage_pathname,blob_checksum).drizzle/0002_vercel_blob.sqlviapnpm db:pushbefore deploying/running the updated upload path.Testing (Manual)
BLOB_READ_WRITE_TOKEN=...pnpm install && pnpm db:pushpnpm dev(or deploy on Vercel with the token)/employer/uploadwith UploadThing disabled:/api/upload-localreturns{ provider: "vercel_blob", url: "https://...vercel-storage.com/..." }curl -I http://localhost:3000/api/files/<id>returns307withLocation: <blob-url>psql $DATABASE_URL -c "select id, storage_provider, storage_url, storage_pathname, blob_checksum, file_data from file_uploads where id=<id>;"shows metadata populated andfile_datais NULL for new rows/api/files/:id(no redirect)Commits
Rollout
BLOB_READ_WRITE_TOKEN(and usual DB + Clerk env vars) in.envor Vercel Project Settings.pnpm install && pnpm db:push.pnpm dev) or redeploy to Vercel./employer/uploadand confirm:curl -I http://localhost:3000/api/files/<id>returns307with Blob URL inLocationfile_datais NULL