drizzle-team / drizzle-team/drizzle-orm

Schema path not working when using custom config path

Open
#3,467 0 comments 0 reactions 0 assignees View on GitHub
bug drizzle/kit priority
Dominant language
TypeScript
Stars
35.8k
Forks
1.6k
Avg merge
2d 7h
Merged PRs (30d)
4

Description

`npx drizzle-kit push:pg --config=../../../../some/path/drizzle.config.ts`
```ts
// drizzle.config.ts
import type { Config } from 'drizzle-kit';

export default {
dbCredentials: {
connectionString: process.env.DATABASE_URL!
},
driver: 'pg',
out: './drizzle',
schema: './src/schema.ts'
} satisfies Config;
```

This code says the schema file cannot be found. However, if I change the schema path to be an absolute path, it works. I think the schema path needs to use relative paths relative to the config file, not from the directory the user is calling the command from.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.