Studio loading forever

Hello everyone 👋

First time using Drizzle here and plan to use it for my next tutorial on youtube. Lovely experience, definitely want to use it regularly.

I have an issue where my studio which I planned to guide my viewers to use as an "admin dashboard" is loading forever after I added my schema relations.

This did not happen before I added unit <=> lesson relationship, before that I could normally load my units and add new records.

Likely there is a dumb mistake I made somewhere 😅

Database is reset and completely clean

Here is my schema:

import { relations } from "drizzle-orm";
import { integer, text, pgTable } from "drizzle-orm/pg-core";

export const units = pgTable("units", {
  id: integer("id").primaryKey(),
  description: text("description").notNull(),
  title: text("title").notNull(),
});

export const unitsRelations = relations(units, ({ many }) => ({
  lessons: many(lessons),
}));

export const lessons = pgTable("lessons", {
  id: integer("id").primaryKey(),
  unitId: integer("unit_id"),
});

export const lessonsRelations = relations(lessons, ({ one }) => ({
  unit: one(units, {
    fields: [lessons.unitId],
    references: [units.id],
  }),
}));
image.png
Was this page helpful?