Skip to content

fix(migrations): watch the migrations out_dir in build::Config::watch - #58

Merged
themixednuts merged 1 commit into
mainfrom
fix/build-watch-out-dir
Aug 7, 2026
Merged

fix(migrations): watch the migrations out_dir in build::Config::watch#58
themixednuts merged 1 commit into
mainfrom
fix/build-watch-out-dir

Conversation

@themixednuts

Copy link
Copy Markdown
Owner

Summary

Config::watch now emits cargo:rerun-if-changed for the migrations output directory in addition to the schema files and TOML config. The previous-snapshot chain under out_dir is a diff input: deleting or reverting a migration folder changes what build::run generates, but without the watch cargo skips the build script and replays cached output — the migration is silently never regenerated. Cargo scans watched directories recursively and treats a not-yet-existing path as changed, so the first run (which creates the directory) converges.

Watch targets are refactored into an assertable watch_targets() helper with tests.

Test plan

  • New watch_targets_* unit tests
  • cargo test -p drizzle-migrations

🤖 Generated with Claude Code

The previous-snapshot chain under out_dir is a diff input: deleting or
reverting a migration folder changes what build::run generates. Without
watching it, cargo sees no changed path, skips the build script, and
replays the cached output — the migration is silently never regenerated.
Cargo scans watched directories recursively and treats a not-yet-existing
path as changed, so the first run (which creates the directory) converges.
Watch targets are split into an assertable watch_targets() helper with
tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cursor

cursor Bot commented Aug 7, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@themixednuts
themixednuts merged commit a64799e into main Aug 7, 2026
35 checks passed
@themixednuts
themixednuts deleted the fix/build-watch-out-dir branch August 7, 2026 09:38
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