Skip to content

Instantly share code, notes, and snippets.

View kyrregjerstad's full-sized avatar

Kyrre Gjerstad kyrregjerstad

View GitHub Profile
const user = createTable("user", {
  id: serial("id").primaryKey(),
  passwordHash: varchar("passwordHash", { length: 255 }).notNull(),
  email: varchar("email", { length: 255 }).notNull().unique(),
  createdAt: timestamp("createdAt", { withTimezone: true }).notNull().defaultNow(),
  updatedAt: timestamp("updatedAt", { withTimezone: true }),
});

export const userRelations = relations(user, ({ one, many }) => ({