drizzle-team / drizzle-team/drizzle-orm
[BUG]: Migrations dropping tables does not consider dependents
- 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.31.2
### What version of `drizzle-kit` are you using?
0.22.8
### Describe the Bug
The previous schema had 3 tables: users, user_auth, user_session. `user_session.userId` was a foreign key to `user_auth.id`. My actions were:
1. delete the user_auth table.
2. `user_session.userId` was a foreign key to `users.id`.
The migrations were:
1. DROP TABLE user_auth;
3. _Altering the constraint of user_session.userId._
However, the 1st command errored since user_session depended on user_auth.
### Expected behavior
Run proper migrations considering dependents with foreign keys.
### Environment & setup
Linux, bun 1.1.17.
Contributor guide
Assessment
This issue has not been assessed yet.