© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•2y ago•
2 replies
Hayden

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'),
});
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

error: relation "session" does not exist
Drizzle TeamDTDrizzle Team / help
2y ago
Error: relation "offers_details" does not exist
Drizzle TeamDTDrizzle Team / help
3y ago
relation 'users' does not exist
Drizzle TeamDTDrizzle Team / help
2y ago
PostgresError: Relation X does not exist - After reorganizing schema
Drizzle TeamDTDrizzle Team / help
3y ago