Skip to content

fix(db): make development schema pushes noninteractive - #7906

Merged
icecrasher321 merged 3 commits into
devfrom
codex/fix-dev-schema-deployment
Sep 17, 2026
Merged

icecrasher321 merged 3 commits into
devfrom
codex/fix-dev-schema-deployment

Conversation

@icecrasher321

@icecrasher321 icecrasher321 commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Make development db:push treat additions and removals as separate creations/deletions across columns, tables, schemas, and other named objects. A version-pinned Drizzle CLI patch supplies this policy through the existing rename resolvers.
  • Add --interactive-renames for intentional local renames using Drizzle’s native chooser. It requires a terminal; --force still controls data-loss approval independently.
  • Return nonzero on PostgreSQL push errors or cancellation, so reconciliation and deployment stop immediately. Remove the schema-specific preparation step and CI log-text workaround.
  • Document usage and patch maintenance in the existing contributor and patch guides. Keep staging and production on versioned migrations.

Type of Change

  • Bug fix

Testing

  • 28 targeted tests passed: seven PostgreSQL CLI tests, seven push orchestration tests, six workflow tests, six database URL tests, and two existing index-diff tests.
  • Tested the actual wrapper in a terminal: an intentional rename preserved the stored value; cancelling a destructive push preserved the schema and skipped reconciliation.
  • Frozen dependency install, database workspace and push-script TypeScript checks, API validation, Biome, migration safety check, and git diff --check passed.
  • Tests used disposable local PostgreSQL fixtures. No deployed database was modified.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Sep 17, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
docs Ready Ready Preview Sep 17, 2026 1:53am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; no actionable new issue or outstanding previous finding remains.

Summary

This PR makes development schema pushes noninteractive by default while preserving an explicit terminal-based rename mode.

  • Pins and patches Drizzle Kit to treat additions and removals as create/drop operations and propagate PostgreSQL failures.
  • Stops post-push reconciliation when schema application or an earlier reconciliation step fails.
  • Simplifies the development migration workflow and documents the schema-push policy and maintenance process.
  • Adds wrapper, PostgreSQL integration, workflow, and database URL coverage.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Development migration workflow] --> B[db:push wrapper]
    B --> C{Interactive renames requested?}
    C -- Yes, with TTY --> D[Native Drizzle rename chooser]
    C -- No --> E[Create/drop rename policy]
    C -- Yes, without TTY --> F[Exit nonzero]
    D --> G[Drizzle schema push]
    E --> G
    G --> H{Push succeeded?}
    H -- No --> F
    H -- Yes --> I[Reconcile credential policies]
    I --> J[Reconcile OAuth providers]
    J --> K[Backfill search vectors]
    K --> L[Success]
Loading

Reviews (3) · Last reviewed commit: "docs(db): describe schema push reconcili..."

Comment thread packages/db/scripts/prepare-dev-schema.ts Outdated
Comment thread packages/db/scripts/prepare-dev-schema.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 5 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread .github/workflows/migrations.yml Outdated
Comment thread packages/db/scripts/prepare-dev-schema.ts Outdated
Comment thread packages/db/scripts/prepare-dev-schema.ts Outdated
@icecrasher321
icecrasher321 requested a review from a team as a code owner September 17, 2026 01:39
@icecrasher321 icecrasher321 changed the title fix(db): resolve dev schema push column ambiguity fix(db): make development schema pushes noninteractive Sep 17, 2026
@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@greptile

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@icecrasher321 I have started the AI code review. It will take a few minutes to complete.

Comment thread packages/db/scripts/push.postgres.test.ts

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 12 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread .github/CONTRIBUTING.md Outdated
@icecrasher321

Copy link
Copy Markdown
Collaborator Author

CI triage for the current implementation:

  • The app build, Helm validation, and desktop E2E checks passed.
  • The failing lint and application-test paths are unchanged from this PR's dev base. I reproduced both stale embedding-error assertions locally: the tests expect the old configuration error while the implementation returns the newer semantic-retrieval error. The CLI formatter failure also reproduces on unchanged source.
  • Both PostgreSQL jobs completed schema provisioning and failed the same eight attachment replay assertions in memory-harness.postgres.test.ts (NO_FILE instead of the expected rejection), including the versioned-migration lane. These are not schema-push failures.
  • The database push coverage passed locally: seven real PostgreSQL CLI cases, seven wrapper cases, six workflow cases, and eight existing database regression cases. This includes create/drop ambiguity, native interactive rename behavior, independent data-loss approval, and nonzero failure propagation.
  • The full local audit suite additionally finds existing import-graph growth, a banned utility pattern in session-file-snapshot.test.ts, and stale generated Table documentation. API validation, route contracts, OpenAPI validation, and the base-sensitive migration check pass.

Keeping this PR scoped to database push behavior and its setup documentation. The repository-wide CI remains red; this comment is not a claim that all merge checks pass.

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@greptile

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@icecrasher321 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot 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.

No issues found across 12 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@icecrasher321
icecrasher321 merged commit 1d57208 into dev Sep 17, 2026
38 of 43 checks passed
@waleedlatif1
waleedlatif1 deleted the codex/fix-dev-schema-deployment branch September 17, 2026 03:30
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.

1 participant