Skip to content

fix(cli): follow drizzle-kit's reported path for drop migrations - #1552

Draft
cipherstash-agent wants to merge 1 commit into
mainfrom
claude/project-thread-1t65aj
Draft

cipherstash-agent wants to merge 1 commit into
mainfrom
claude/project-thread-1t65aj

Conversation

@cipherstash-agent

Copy link
Copy Markdown
Contributor

Requested by CipherStash · project thread

Summary

stash encrypt drop and stash decrypt drop could write a Drizzle drop migration to the wrong folder (CIP-5162). They ran drizzle-kit generate --custom, then looked for the file in --migrations-dir (default ./drizzle) instead of the out in drizzle.config.ts. When the two differed, drizzle-kit journaled an empty stub in the real out, and the SQL was either lost or written over an older same-stem migration. drizzle-kit migrate then applied the empty stub, so the DROP never shipped.

Changes

decrypt plan is not affected: on Drizzle projects it writes no file.

Verification

  • New drizzle-helper.test.ts (7 cases): config out differing from --migrations-dir, fallback scan, refusal to overwrite, colourised banner, error output.
  • find-generated-migration tests pass; Biome reports no errors.
  • Not run: the rest of the CLI suite. The native @cipherstash/auth binding isn't built in this environment, so about 27 unrelated test files can't load.
  • Commit is unsigned: no SSH signing key is configured in this environment.

Related

Linear CIP-5162.


Generated by Claude Code

…grations

encrypt drop and decrypt drop scanned --migrations-dir for the file
drizzle-kit wrote, ignoring the out in drizzle.config.ts. When the two
differed, the SQL overwrote an older same-stem migration while drizzle-kit
journaled an empty stub in the real out, so the DROP never shipped.

Use the path drizzle-kit reports (shared with eql migration), fall back to
an exact-suffix scan that refuses pre-existing files, and refuse to
overwrite any non-empty file. Warn when --migrations-dir is overridden.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Jmn7rkoV6gTBkz2uGSR3H
@changeset-bot

changeset-bot Bot commented Nov 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c2798f0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
stash Patch
@cipherstash/basic-example Patch
@cipherstash/e2e Patch
@cipherstash/stack-drizzle Patch
@cipherstash/stack-prisma Patch
@cipherstash/stack-supabase Patch
@cipherstash/stack Patch
@cipherstash/wizard Patch
@cipherstash/bench Patch
@cipherstash/prisma-example Patch
@cipherstash/test-kit Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

@cipherstash-agent cipherstash-agent self-assigned this Nov 6, 2026

This branch has not been deployed

No deployments
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