Haydz
DTDrizzle Team
•Created by Haydz on 9/4/2024 in #help
error: relation "X" does not exist
Hi I've been trying for awhile and can't seem to figure this out. I converted from prisma to use Drizzle. It works locally in my docker container but when I build my TS project then try run it or deploy it I get the following error...
error: relation "tours" does not exist
export const tours = pgTable("tours", {
id: uuid("id").defaultRandom().primaryKey().notNull(),
sport: uuid("sport").notNull(),
fullName: varchar("full_name", { length: 255 }).notNull(),
name: varchar("name", { length: 255 }).notNull(),
slug: varchar("slug", { length: 255 }).notNull(),
logo: varchar("logo", { length: 255 }),
},
(table) => {
return {
slugUnique: uniqueIndex("tours_slug_unique").using("btree", table.slug.asc().nullsLast()),
toursSportForeign: foreignKey({
columns: [table.sport],
foreignColumns: [sports.id],
name: "tours_sport_foreign"
}),
}
});
// When I call this I get error: relation "tours" does not exist
const tour = await db.query.tours.findFirst({
where: eq(tours.slug, 'pga-tour'),
});
3 replies