Skip to content

fix: auto-create data/ directory before db:push - #2

Open
antoinecaputo wants to merge 1 commit into
hadijaveed:mainfrom
antoinecaputo:fix/data-dir-init
Open

fix: auto-create data/ directory before db:push#2
antoinecaputo wants to merge 1 commit into
hadijaveed:mainfrom
antoinecaputo:fix/data-dir-init

Conversation

@antoinecaputo

Copy link
Copy Markdown

Fixes #1

Problem

On a fresh clone, npm run db:push fails immediately with SQLite error 14 because the data/ directory is listed in .gitignore and therefore never exists in the working tree.

Error: ConnectionFailed("Unable to open connection to local database ./data/finance.db: 14")

Changes

  • package.json: Prepend mkdir -p data to the db:push script so the directory is always created before drizzle-kit runs. Zero impact on subsequent runs (mkdir -p is idempotent).
  • README.md: Add a one-line callout in Quick Start noting that db:push handles the directory automatically.

Generated with Warp

Co-Authored-By: Oz oz-agent@warp.dev

SQLite error 14 on fresh clones because the data/ directory is
gitignored and therefore absent. Prepend mkdir -p data to the
db:push script so it is always created before drizzle-kit runs.
Also add a brief note in the README Quick Start.

Fixes hadijaveed#1

Co-Authored-By: Oz <oz-agent@warp.dev>
@antoinecaputo

Copy link
Copy Markdown
Author

Hi @hadijaveed, this fixes db:push failure on fresh clones due to the missing data/ directory.
One-line change to package.json + a README note :)

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.

db:push fails on fresh clone: data/ directory missing

1 participant