Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: bigint as primary key #1626

Merged
merged 1 commit into from
Mar 30, 2021
Merged

Conversation

Vakrim
Copy link
Contributor

@Vakrim Vakrim commented Mar 30, 2021

This PR adds bigint as acceptable type of isPrimaryKey.

I was following https://mikro-orm.io/docs/using-bigint-pks recipe, but saw that update queries were missing where clause when using bigint as PK.

I've pinpointed issue to those lines that doesn't prepare correct where object for knex when where is of bigint type.

if (Utils.isPrimaryKey(where) && pks.length === 1) {
where = { [pks[0]]: where } as FilterQuery<T>;
}

@B4nan B4nan merged commit bce7afe into mikro-orm:master Mar 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants