© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•3y ago
RØÇKS

Error starting Drizzle Studio.

Hi, I am new to drizzle, and rand into some issues starting drizzle studio, mentioned below.
ules/drizzle-orm/index-1899b9ae.cjs:4180
    throw new Error(`There is not enough information to infer relation "${sourceTableTsName}.${relation.fieldName}"`);
          ^

Error: There is not enough information to infer relation "Links.filters"
ules/drizzle-orm/index-1899b9ae.cjs:4180
    throw new Error(`There is not enough information to infer relation "${sourceTableTsName}.${relation.fieldName}"`);
          ^

Error: There is not enough information to infer relation "Links.filters"


My table schema is:
export const Links = pgTable(
  "user_links",
  {
    linkId: uuid("link_id")
      .default(sql`gen_random_uuid()`)
      .primaryKey()
      .unique(),
    userId: uuid("user_id").references(() => Users.userId),
    parentUrl: varchar("parent_url").notNull(),
    urlHash: varchar("url_hash", { length: 256 }).notNull().unique(),
    maskedUrl: varchar("masked_url", { length: 256 }).notNull(),
    otpMethod: varchar("otp_method", {
      enum: [OTP_METHODS.EMAIL, OTP_METHODS.MOBILE, OTP_METHODS.BOTH],
    }).notNull(),
    filter_comparison: text("filter_comparison", {
      enum: [FILTER_COMPARE.AND, FILTER_COMPARE.OR],
    }),
    filters: uuid("filter_ids_check")
      .references(() => Filters.filterId)
      .array(),
    createdAt: timestamp("created_at").defaultNow().notNull(),
    updatedAt: timestamp("updated_at").defaultNow().notNull(),
  },
  (table) => {
    return {
      urlHashIndex: index("hash_index").on(table.urlHash),
    };
  },
);
export const Links = pgTable(
  "user_links",
  {
    linkId: uuid("link_id")
      .default(sql`gen_random_uuid()`)
      .primaryKey()
      .unique(),
    userId: uuid("user_id").references(() => Users.userId),
    parentUrl: varchar("parent_url").notNull(),
    urlHash: varchar("url_hash", { length: 256 }).notNull().unique(),
    maskedUrl: varchar("masked_url", { length: 256 }).notNull(),
    otpMethod: varchar("otp_method", {
      enum: [OTP_METHODS.EMAIL, OTP_METHODS.MOBILE, OTP_METHODS.BOTH],
    }).notNull(),
    filter_comparison: text("filter_comparison", {
      enum: [FILTER_COMPARE.AND, FILTER_COMPARE.OR],
    }),
    filters: uuid("filter_ids_check")
      .references(() => Filters.filterId)
      .array(),
    createdAt: timestamp("created_at").defaultNow().notNull(),
    updatedAt: timestamp("updated_at").defaultNow().notNull(),
  },
  (table) => {
    return {
      urlHashIndex: index("hash_index").on(table.urlHash),
    };
  },
);
image.png
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

Drizzle studio error: 1f71faac182a4ee6b3dc5cf39f7d0b37
Drizzle TeamDTDrizzle Team / help
8mo ago
Error in Drizzle.studio
Drizzle TeamDTDrizzle Team / help
11mo ago
Drizzle Kit studio error
Drizzle TeamDTDrizzle Team / help
2y ago
Error using drizzle-kit studio
Drizzle TeamDTDrizzle Team / help
2y ago