drizzle-team / drizzle-team/drizzle-orm

[BUG]: Allow absolute path to migration output directory

Open
#3,217 3 comments 3 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

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

?

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

?

### Describe the Bug

From drizzle-kit-mirror repo: https://github.com/drizzle-team/drizzle-kit-mirror/issues/81.

> I'm working on a project containing many custom CLI tooling to trigger different CLI commands from different libraries. To have the most reliable file path to execute, we will normally use absolute paths for all configs.
>
> With that said, Drizzle-ORM Kit is currently auto-adding a relative prefix path (`./`) to the config path without checking whether it is absolute or not when using `drizzle-kit generate:mysql` command. We can have a workaround to modify our custom CLI to handle this library specifically but it would be best to have the kit to handle it automatically.
>
> Another reason is, the same absolute path in the migrate function (provided by `drizzle-orm//migrator`) will work perfectly fine. It's better to have this behavior consistent.
>
> The idea can be: checking if the path provided is a valid "absolute" path, or will add the prefix afterward.
>
> Below is the current behavior.
>
> ![image](https://private-user-images.githubusercontent.com/29449869/245111941-9c9d1d3a-5be8-4cd2-b0e3-eea70078326c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzAxMzg1OTAsIm5iZiI6MTczMDEzODI5MCwicGF0aCI6Ii8yOTQ0OTg2OS8yNDUxMTE5NDEtOWM5ZDFkM2EtNWJlOC00Y2QyLWIwZTMtZWVhNzAwNzgzMjZjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDEwMjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMDI4VDE3NTgxMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk2MDNhZDBhZmQzYjNjYmFiNmU3MGZjNWVkYmUyODI2Njc4NGQzYmVhMzY1OTEyNTc1MTcwNTYxYWJhZmI1ODkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.qDYpQWP85nuvX7KfZoLd3EDmlCOyzJTrpKx6UL6yUsw)

### 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.