PostgresError: relation "Session" does not exist

I'm getting this error, but in my schema and my database, the table name is lower case.
export const sessions = pgTable(
"session",
{
sessionToken: varchar("sessionToken").primaryKey().notNull(),
userId: varchar("userId")
.notNull()
.references(() => users.id, { onUpdate: "cascade", onDelete: "cascade" }),
expires: timestamp("expires", { mode: "date" }).notNull()
},
(table) => {
return {
userIdIdx: index("Session_userId_idx").on(table.userId)
};
}
);
export const sessions = pgTable(
"session",
{
sessionToken: varchar("sessionToken").primaryKey().notNull(),
userId: varchar("userId")
.notNull()
.references(() => users.id, { onUpdate: "cascade", onDelete: "cascade" }),
expires: timestamp("expires", { mode: "date" }).notNull()
},
(table) => {
return {
userIdIdx: index("Session_userId_idx").on(table.userId)
};
}
);
No description
1 Reply
Sillvva
SillvvaOP9mo ago
:FacePalm: I had a function referencing the table as "Session"
Want results from more Discord servers?
Add your server