mirror of
https://github.com/ArthurDanjou/arthome.git
synced 2026-01-14 20:19:26 +01:00
Working
This commit is contained in:
@@ -7,7 +7,7 @@ export const subscriptionEnum = pgEnum('subscription', Subscription)
|
||||
|
||||
export const users = pgTable('users', {
|
||||
id,
|
||||
username: text('username').notNull(),
|
||||
username: text('username').notNull().unique(),
|
||||
name: text('name').notNull(),
|
||||
email: text('email').notNull().unique(),
|
||||
githubId: text('github_id').unique(),
|
||||
@@ -59,3 +59,10 @@ export const categoriesRelations = relations(categories, ({ one, many }) => ({
|
||||
}),
|
||||
tabs: many(tabs),
|
||||
}))
|
||||
|
||||
export const tabsRelations = relations(tabs, ({ one }) => ({
|
||||
category: one(categories, {
|
||||
fields: [tabs.categoryId],
|
||||
references: [categories.id],
|
||||
}),
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user