export const users = pgTable('users', {
id: text('id').notNull().primaryKey(),
name: text('name'),
email: text('email').notNull(),
emailVerified: timestamp('emailVerified', { mode: 'date' }),
image: text('image'),
createdAt: timestamp('createdAt', { mode: 'date' }).notNull(),
updatedAt: timestamp('updatedAt', { mode: 'date' }).notNull(),
})
export const userRelations = relations(users, ({ one }) => ({
jobSeekerProfile: one(jobSeekerProfiles, {
fields: [users.id],
references: [jobSeekerProfiles.userId],
}),
}))
export const jobSeekerProfiles = pgTable('jobSeekerProfiles', {
id: text('id').notNull().primaryKey(),
userId: text('userId')
.notNull()
.references(() => users.id, { onDelete: 'cascade' }),
bio: text('bio'),
cvUrl: text('cvUrl'),
})
export const users = pgTable('users', {
id: text('id').notNull().primaryKey(),
name: text('name'),
email: text('email').notNull(),
emailVerified: timestamp('emailVerified', { mode: 'date' }),
image: text('image'),
createdAt: timestamp('createdAt', { mode: 'date' }).notNull(),
updatedAt: timestamp('updatedAt', { mode: 'date' }).notNull(),
})
export const userRelations = relations(users, ({ one }) => ({
jobSeekerProfile: one(jobSeekerProfiles, {
fields: [users.id],
references: [jobSeekerProfiles.userId],
}),
}))
export const jobSeekerProfiles = pgTable('jobSeekerProfiles', {
id: text('id').notNull().primaryKey(),
userId: text('userId')
.notNull()
.references(() => users.id, { onDelete: 'cascade' }),
bio: text('bio'),
cvUrl: text('cvUrl'),
})