mirror of
https://github.com/fosrl/pangolin.git
synced 2025-06-29 00:20:04 +02:00
check for stale users on signup
This commit is contained in:
parent
3a52615e3e
commit
6fb569e2cd
4 changed files with 55 additions and 7 deletions
|
@ -81,6 +81,7 @@ export const users = sqliteTable("user", {
|
|||
emailVerified: integer("emailVerified", { mode: "boolean" })
|
||||
.notNull()
|
||||
.default(false),
|
||||
dateCreated: text("dateCreated").notNull(),
|
||||
});
|
||||
|
||||
export const twoFactorBackupCodes = sqliteTable("twoFactorBackupCodes", {
|
||||
|
@ -107,7 +108,9 @@ export const userOrgs = sqliteTable("userOrgs", {
|
|||
orgId: integer("orgId")
|
||||
.notNull()
|
||||
.references(() => orgs.orgId),
|
||||
roleId: integer("roleId").notNull().references(() => roles.roleId),
|
||||
roleId: integer("roleId")
|
||||
.notNull()
|
||||
.references(() => roles.roleId),
|
||||
});
|
||||
|
||||
export const emailVerificationCodes = sqliteTable("emailVerificationCodes", {
|
||||
|
@ -137,7 +140,9 @@ export const actions = sqliteTable("actions", {
|
|||
|
||||
export const roles = sqliteTable("roles", {
|
||||
roleId: integer("roleId").primaryKey({ autoIncrement: true }),
|
||||
orgId: integer("orgId").references(() => orgs.orgId, { onDelete: "cascade" }),
|
||||
orgId: integer("orgId").references(() => orgs.orgId, {
|
||||
onDelete: "cascade",
|
||||
}),
|
||||
name: text("name").notNull(),
|
||||
description: text("description"),
|
||||
});
|
||||
|
@ -204,7 +209,9 @@ export const userResources = sqliteTable("userResources", {
|
|||
|
||||
export const limitsTable = sqliteTable("limits", {
|
||||
limitId: integer("limitId").primaryKey({ autoIncrement: true }),
|
||||
orgId: integer("orgId").references(() => orgs.orgId, { onDelete: "cascade" }),
|
||||
orgId: integer("orgId").references(() => orgs.orgId, {
|
||||
onDelete: "cascade",
|
||||
}),
|
||||
name: text("name").notNull(),
|
||||
value: integer("value").notNull(),
|
||||
description: text("description"),
|
||||
|
@ -232,4 +239,4 @@ export type RoleSite = InferSelectModel<typeof roleSites>;
|
|||
export type UserSite = InferSelectModel<typeof userSites>;
|
||||
export type RoleResource = InferSelectModel<typeof roleResources>;
|
||||
export type UserResource = InferSelectModel<typeof userResources>;
|
||||
export type Limit = InferSelectModel<typeof limitsTable>;
|
||||
export type Limit = InferSelectModel<typeof limitsTable>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue