basic invite user functional

This commit is contained in:
Milo Schwartz 2024-11-02 23:46:08 -04:00
parent a6bb8f5bb1
commit a6baebb216
No known key found for this signature in database
15 changed files with 684 additions and 137 deletions

View file

@ -210,13 +210,13 @@ export const userInvites = sqliteTable("userInvites", {
inviteId: text("inviteId").primaryKey(),
orgId: text("orgId")
.notNull()
.references(() => orgs.orgId),
.references(() => orgs.orgId, { onDelete: "cascade" }),
email: text("email").notNull(),
expiresAt: integer("expiresAt").notNull(),
tokenHash: text("token").notNull(),
roleId: integer("roleId")
.notNull()
.references(() => roles.roleId),
.references(() => roles.roleId, { onDelete: "cascade" }),
});
export type Org = InferSelectModel<typeof orgs>;