refactor: add migration

This commit is contained in:
Mauricio Siu
2025-02-13 00:38:22 -06:00
parent 60eee55f2d
commit 23f1ce17de
13 changed files with 5661 additions and 78 deletions

View File

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