drizzle-team / drizzle-team/drizzle-orm

Relationships with "binary" data type not working

Open
#3,375 0 comments 0 reactions 0 assignees View on GitHub
bug db/mysql drizzle/kit drizzle/studio priority
Dominant language
TypeScript
Stars
35.8k
Forks
1.6k
Avg merge
2d 7h
Merged PRs (30d)
4

Description

When having a relationship like this
```js
export const users = mysqlTable("users", {
_id: serial("_id").primaryKey()
})
export const profiles = mysqlTable("profiles", {
userId: int("userId").references(() => users._id),
});
```
the studio shows the linked row properly.

But when having it with binary data type, like this:
```js
export const users = mysqlTable("users", {
_id: binary("userId", { length: 16 }).notNull().primaryKey()
})
export const profiles = mysqlTable("profiles", {
userId: binary("userId", { length: 16 })
.references(() => users._id),
});
```
the studio doesn't show the linked row of the other table

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.