Skip to content

[DOCUMENTATION]: Typo in the code #2840

@MrOxMasTer

Description

@MrOxMasTer

What version of drizzle-orm are you using?

0.33.0

What version of drizzle-kit are you using?

0.23.0

Describe the Bug

https://orm.drizzle.team/docs/rqb#foreign-keys

export const users = pgTable('users', {
  id: serial('id').primaryKey(),
  name: text('name'),
});
export const usersRelations = relations(users, ({ one, many }) => ({
  profileInfo: one(users, {  // the table is specified incorrectly
    fields: [profileInfo.userId],
    references: [users.id],
  }),
}));
export const profileInfo = pgTable('profile_info', {
  id: serial('id').primaryKey(),
  userId: integer("user_id"),
  metadata: jsonb("metadata"),
});

image
image

The types match
image

Expected behavior

No response

Environment & setup

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug/fixed-in-betaThis bug has been fixed in beta (or will be soon).docsImprovements or additions to documentationdocs/incorrectrqbrelational queries

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions