drizzle-team / drizzle-team/drizzle-orm

[BUG]: introspect creates `schema.ts` within `out` dir, not at schema path in `drizzle.config.ts`

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

Description

### What version of `drizzle-orm` are you using?

0.28.6

### What version of `drizzle-kit` are you using?

0.19.13

### Describe the Bug

1. Given `drizzle.config.ts`:

```ts
import { Config } from 'drizzle-kit';

export default {
dbCredentials: {
authToken: process.env.TURSO_DB_AUTH_TOKEN as string,
url: process.env.TURSO_DB_URL as string,
},
driver: 'turso',
out: './drizzle/migrations', // <<<
schema: './drizzle/schema.ts', // <<<
strict: true,
verbose: true,
} satisfies Config;
```

2. Run `npm run migration:introspect`, which uses `"migration:introspect": "drizzle-kit introspect:sqlite",`.

### Behavior

- Expected behavior is for `schema.ts` to be created at `./drizzle/schema.ts` and to overwrite any existing file there.
- Actual behavior, creates a new schema file at `./drizzle/migrations/schema.ts` _within the migrations dir_.

### Expected behavior

_No response_

### Environment & setup

_No response_

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.