drizzle-team / drizzle-team/drizzle-orm

[FEATURE]: migrations in TypeScript / `drizzle-kit generate --typescript`

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

Description

### Describe what you want

I'd love to see support for migrations in TypeScript. It would make life so much easier.

After we do a schema migration, we often need to migrate data too. This usually involves:

1. Selecting the data
2. Preparing it
3. Inserting or updating it

Sure, you can do this with plain SQL, but it’s not as simple or nice as writing a script in TypeScript.

Right now, we have to create a TypeScript script and run it manually, which is a pain because:

- **Manual Work:** Running scripts manually is prone to mistakes and is just extra work. It’s easy to mess up the order or the environment, especially with a team.

- **CI/CD Hassles:** Our CI/CD setup doesn’t handle these scripts automatically. We have to apply every migration by hand, which breaks the smooth automation we’re aiming for.

- **Tracking Issues:** Unlike schema migrations, these scripts don’t get tracked automatically, so we lose the history of what’s been applied. This can lead to inconsistent environments.

drizzle-kit already does a great job tracking and running schema migrations. It would be awesome if it could handle data migrations too, making the whole process smoother and less error-prone.

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.