Drizzle Studio: Cannot read properties of undefined (reading 'name')

hey drizzle team, been trying to migrate from prisma to drizzle, but I can't seem to get the studio working. after running npx drizzle-kit studio, i get error you see in the image.

here's my schema.ts, which is inside drizzle/schema/schema.ts
export const user = pgTable('user', {
  id: uuid('id').primaryKey(),
  profileId: serial('profile_id').references(() => profile.id),
});

export const profile = pgTable('profile', {
  id: serial('id').primaryKey(),
  email: text('email').unique(),
  name: text('name'),
  gender: genderEnum('gender'),
  dob: timestamp('dob', { precision: 6, withTimezone: true }),
  updatedAt: timestamp('updated_at', { mode: 'date', precision: 3 }).$onUpdate(
    () => new Date(),
  ),
});


drizzle.config.ts
import type { Config } from 'drizzle-kit';
const DATABASE_URL = process.env.DATABASE_URL;
if (!DATABASE_URL) {
  throw new Error('DATABASE_URL is not set');
}
export default {
  schema: ['./drizzle/schema/*.ts'],
  out: './drizzle',
  driver: 'pg',
  dbCredentials: {
    connectionString: DATABASE_URL,
  },
  verbose: true,
  strict: true,
} satisfies Config;


even after clearing out my schema.ts, resetting my local supabase db, i still get the same error.

was wondering if anyone has faced the same issue or could share how they manage to resolve this? thanks!
image.png
Was this page helpful?