drizzle-team / drizzle-team/drizzle-orm
Config out / schemas / migrations are confusing. Also, no way to prevent migrations being generating
- Dominant language
- TypeScript
- Stars
- 35.8k
- Forks
- 1.6k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 4
Description
### Feature hasn't been suggested before.
- [x] I have verified this feature I'm about to request hasn't been suggested before.
### Describe the enhancement you want to request
When I run
```
pnpm exec drizzle-kit pull
```
wtih
```
export default defineConfig({
dialect: "postgresql",
out: "./src/db/a_db/",
schema: "schema.ts"
});
```
The output is
```
...
[โ] Your SQL migration file โ src/db/a_db/0000_shiny_argent.sql ๐
[โ] Your schema file is ready โ src/db/a_db/schema.ts ๐
[โ] Your relations file is ready โ src/db/a_db/relations.ts ๐
...
```
But I don't want migration, all I need is the schemas. How can I tell drizzle to stop generating migrations?
And with
```
export default defineConfig({
dialect: "postgresql",
schema: "./src/db/a_db/schema.ts"
});
```
I get
```
[โ] Your SQL migration file โ drizzle/0000_large_freak.sql ๐
[โ] Your schema file is ready โ drizzle/schema.ts ๐
[โ] Your relations file is ready โ drizzle/relations.ts ๐
```
So it completely ignores the path I give to schema if there is no out. And still, it generates migrations I don't need (I am _pulling_ from the db).
```
export default defineConfig({
dialect: "postgresql",
schema: "./src/db/a_db/schema.ts"
migration: "/tmp/go_away"
});
```
I get
```
[โ] Your SQL migration file โ drizzle/0000_striped_mongu.sql ๐
[โ] Your schema file is ready โ drizzle/schema.ts ๐
[โ] Your relations file is ready โ drizzle/relations.ts ๐
```
So it's clear that
1. `out` is actually a dir (would be clear if named `outDir`)
2. `out` is required, otherwise files will be created into ./drizzle/, regardless of what you put in schema / migration
3. `schema` and `migration` cannot go in different folders
4. you cannot prevent migrations even if you don't need them
I guess if drizzle could honour the paths and schema and migration then we could sent migrations to /tmp/something and forget about it.
Contributor guide
Assessment
This issue has not been assessed yet.