feat: migrate rest schemas

This commit is contained in:
Mauricio Siu
2025-02-13 00:45:29 -06:00
parent 7c62408070
commit 0d525398a8
12 changed files with 5348 additions and 30 deletions

View File

@@ -49,9 +49,9 @@ export const notifications = pgTable("notification", {
// userId: text("userId").references(() => user.userId, {
// onDelete: "cascade",
// }),
adminId: text("adminId")
userId: text("userId")
.notNull()
.references(() => admins.adminId, { onDelete: "cascade" }),
.references(() => users_temp.id, { onDelete: "cascade" }),
});
export const slack = pgTable("slack", {
@@ -126,9 +126,9 @@ export const notificationsRelations = relations(notifications, ({ one }) => ({
fields: [notifications.gotifyId],
references: [gotify.gotifyId],
}),
admin: one(admins, {
fields: [notifications.adminId],
references: [admins.adminId],
user: one(users_temp, {
fields: [notifications.userId],
references: [users_temp.id],
}),
}));