chore(deploy): Add Neon restore workflow#33
Open
mathemage wants to merge 1 commit into
Open
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a Neon-focused operational path for Vercel deployments by separating “runtime” vs “admin” database URLs, plus a script to transfer Django data into a PostgreSQL target as part of moving off the hosted SQLite emergency fallback.
Changes:
- Update
scripts/vercel-build.shto preferDATABASE_ADMIN_URLfor migration-time checks/migrations while keeping runtime checks onDATABASE_URL. - Add
scripts/transfer-django-data.shfor SQLite/PostgreSQL → PostgreSQL data transfers viadumpdata/loaddata. - Refresh docs and add script-focused tests covering the new deploy/transfer behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/vercel-build.sh | Uses DATABASE_ADMIN_URL for migration-time check_database + migrate when present. |
| scripts/transfer-django-data.sh | New transfer script that exports from SOURCE_DATABASE_URL and imports into TARGET_DATABASE_URL. |
| core/tests/test_scripts.py | New tests that stub python to verify the scripts pass the intended env/args. |
| README.md | Documents Neon branch strategy and runtime/admin URL split; updates backup/restore guidance and transfer instructions. |
| .env.example | Documents optional DATABASE_ADMIN_URL alongside DATABASE_URL. |
| plan.md | Updates stack wording to “PostgreSQL with Neon”. |
| AGENTS.md | Aligns agent guidance with Neon-backed PostgreSQL hosting. |
Comment on lines
+114
to
+116
| assert commands[4].startswith( | ||
| f"{TARGET_URL}|manage.py loaddata /tmp/deep-workflow-transfer." | ||
| ) |
| echo "TARGET_DATABASE_URL is required. Point it at the PostgreSQL database you want to import into." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
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.
Why
Issue #30 needs the repository to support a clean Neon-backed PostgreSQL handoff from the temporary hosted SQLite recovery path, with a setup that is simple to operate on Vercel.
What changed
main+previewbranch strategy for Vercel production and preview deploymentsDATABASE_URLas the pooled runtime URL andDATABASE_ADMIN_URLas the direct admin URL for migrations, backup, restore, and data transfer workscripts/vercel-build.shto useDATABASE_ADMIN_URLfor migration-time checks and migrations when it is availablescripts/transfer-django-data.shto move Django data from SQLite or PostgreSQL into a PostgreSQL target databaseOut of scope
Refs #30