Improve group management by adding parent-child relationships and fixing data validation issues.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 9111ef36-26c8-4085-84ca-a35dc1fec1b5
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7083d608-d6d3-4a6a-9a27-6286c5109627/1e08dc6e-3788-4c72-923e-ae8af43c2a9a.jpg
This commit is contained in:
alphaeusmote
2025-04-10 12:54:31 +00:00
parent dbb001bb0e
commit 771f0e2b59
4 changed files with 1202 additions and 1 deletions
@@ -0,0 +1 @@
ALTER TABLE "groups" ADD CONSTRAINT "groups_parent_group_id_groups_id_fk" FOREIGN KEY ("parent_group_id") REFERENCES "public"."groups"("id") ON DELETE set null ON UPDATE no action;
File diff suppressed because it is too large Load Diff
+7
View File
@@ -8,6 +8,13 @@
"when": 1744253263119,
"tag": "0000_tough_crystal",
"breakpoints": true
},
{
"idx": 1,
"version": "7",
"when": 1744289580482,
"tag": "0001_tearful_daimon_hellstrom",
"breakpoints": true
}
]
}
+1 -1
View File
@@ -149,7 +149,7 @@ export const groups = pgTable("groups", {
isActive: boolean("is_active").default(true).notNull(),
createdAt: timestamp("created_at").defaultNow().notNull(),
createdBy: uuid("created_by").notNull().references(() => users.id, { onDelete: "set null" }),
parentGroupId: uuid("parent_group_id"),
parentGroupId: uuid("parent_group_id").references(() => groups.id, { onDelete: "set null" }),
});
// Group members - can be users, organizations, or other groups