© 2026 Hedgehog Software, LLC
export const categoriesTable = pgTable( 'categories', { id: uuid('id').primaryKey(), name: varchar('name', { length: 50 }).notNull(), description: text('description'), parentId: uuid('parent_id').references(() => categoriesTable.id, { onDelete: 'set null' }), createdAt: timestamp('created_at').defaultNow() }, (table) => ({ nameIdx: uniqueIndex('name_idx').on(table.name) }) )
categoriesTable
any
.references(() => categoriesTable.id, { onDelete: 'set null' })