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

Drizzle Postgres schema is incorrect for unique constraints. #12544

Open
ralphsmith80 opened this issue Jan 24, 2025 · 0 comments
Open

Drizzle Postgres schema is incorrect for unique constraints. #12544

ralphsmith80 opened this issue Jan 24, 2025 · 0 comments
Labels
triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.

Comments

@ralphsmith80
Copy link

What is the improvement or update you wish to see?

The Postgres schema document here shows appling unique constraints like this.

(account) => [
  {
    compoundKey: primaryKey({
      columns: [account.provider, account.providerAccountId],
    }),
  },
]

However, the implementation for drizzle and the documentation as changed. It instead of using array notation [] it should use object notation {}.

(account) => {
  return {
    compoundKey: primaryKey({
      columns: [account.provider, account.providerAccountId],
    }),
  }
}

I originally thought this was a drizzle-orm bug and you can read about the details, tests, and fix (documentation) in that issue drizzle-team/drizzle-orm#3958.

Is there any context that might help us understand?

The drizzle-team/drizzle-orm#3958 issue is very thorough.

Does the docs page already exist? Please link to it.

https://orm.drizzle.team/docs/indexes-constraints#indexes

@ralphsmith80 ralphsmith80 added the triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime. label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
Projects
None yet
Development

No branches or pull requests

1 participant