Skip to content

chore(deploy): Add Neon restore workflow#33

Open
mathemage wants to merge 1 commit into
mainfrom
chore/neon-postgres-restore
Open

chore(deploy): Add Neon restore workflow#33
mathemage wants to merge 1 commit into
mainfrom
chore/neon-postgres-restore

Conversation

@mathemage

Copy link
Copy Markdown
Owner

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

  • documented the recommended Neon main + preview branch strategy for Vercel production and preview deployments
  • documented DATABASE_URL as the pooled runtime URL and DATABASE_ADMIN_URL as the direct admin URL for migrations, backup, restore, and data transfer work
  • updated scripts/vercel-build.sh to use DATABASE_ADMIN_URL for migration-time checks and migrations when it is available
  • added scripts/transfer-django-data.sh to move Django data from SQLite or PostgreSQL into a PostgreSQL target database
  • added automated tests for the deployment scripts and refreshed the related deployment docs

Out of scope

  • directly provisioning Neon or Vercel resources from this PR
  • automating per-PR Neon branch creation

Refs #30

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 3, 2026 17:51
@vercel

vercel Bot commented May 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
deep-workflow Error Error May 3, 2026 5:51pm

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.sh to prefer DATABASE_ADMIN_URL for migration-time checks/migrations while keeping runtime checks on DATABASE_URL.
  • Add scripts/transfer-django-data.sh for SQLite/PostgreSQL → PostgreSQL data transfers via dumpdata/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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants