Cannot Access Primary Key on Table

Hello, I am trying to access the primary key named
id
on the following table:

export const invites = mysqlTable(
    "invites",
    {
        inviteeID: varchar("invitee_id", { length: 255 }).notNull(),
        teamID: varchar("team_id", { length: 50 }).notNull(),
        createdAt: timestamp("created_at").notNull().defaultNow(),
        status: mysqlEnum("status", ["pending", "accepted", "declined"]).notNull().default("pending"),
    },
    (table) => ({
        id: primaryKey(table.inviteeID, table.teamID),
    })
);


I am using the following command to try to update a row but I am getting an error and the
id
field does not show on the invite. Any idea why this might be? Thanks!

await db.update(invites).set({ status: "accepted" }).where(eq(invites.id, user.invites[0].id));
Was this page helpful?