mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-05 18:26:40 +00:00
otp schema
This commit is contained in:
@@ -287,16 +287,28 @@ export const resourceSessions = sqliteTable("resourceSessions", {
|
|||||||
() => resourcePassword.passwordId,
|
() => resourcePassword.passwordId,
|
||||||
{
|
{
|
||||||
onDelete: "cascade",
|
onDelete: "cascade",
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
pincodeId: integer("pincodeId").references(
|
pincodeId: integer("pincodeId").references(
|
||||||
() => resourcePincode.pincodeId,
|
() => resourcePincode.pincodeId,
|
||||||
{
|
{
|
||||||
onDelete: "cascade",
|
onDelete: "cascade",
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const resourceOtp = sqliteTable("resourceOtp", {
|
||||||
|
otpId: integer("otpId").primaryKey({
|
||||||
|
autoIncrement: true,
|
||||||
|
}),
|
||||||
|
resourceId: integer("resourceId")
|
||||||
|
.notNull()
|
||||||
|
.references(() => resources.resourceId, { onDelete: "cascade" }),
|
||||||
|
email: text("email").notNull(),
|
||||||
|
otpHash: text("otpHash").notNull(),
|
||||||
|
expiresAt: integer("expiresAt").notNull(),
|
||||||
|
});
|
||||||
|
|
||||||
export type Org = InferSelectModel<typeof orgs>;
|
export type Org = InferSelectModel<typeof orgs>;
|
||||||
export type User = InferSelectModel<typeof users>;
|
export type User = InferSelectModel<typeof users>;
|
||||||
export type Site = InferSelectModel<typeof sites>;
|
export type Site = InferSelectModel<typeof sites>;
|
||||||
@@ -325,3 +337,4 @@ export type UserOrg = InferSelectModel<typeof userOrgs>;
|
|||||||
export type ResourceSession = InferSelectModel<typeof resourceSessions>;
|
export type ResourceSession = InferSelectModel<typeof resourceSessions>;
|
||||||
export type ResourcePincode = InferSelectModel<typeof resourcePincode>;
|
export type ResourcePincode = InferSelectModel<typeof resourcePincode>;
|
||||||
export type ResourcePassword = InferSelectModel<typeof resourcePassword>;
|
export type ResourcePassword = InferSelectModel<typeof resourcePassword>;
|
||||||
|
export type ResourceOtp = InferSelectModel<typeof resourceOtp>;
|
||||||
|
|||||||
Reference in New Issue
Block a user