mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-16 22:14:29 +00:00
♻️ update DB
This commit is contained in:
@@ -96,6 +96,8 @@ export const sites = pgTable("sites", {
|
|||||||
|
|
||||||
export const resources = pgTable("resources", {
|
export const resources = pgTable("resources", {
|
||||||
resourceId: serial("resourceId").primaryKey(),
|
resourceId: serial("resourceId").primaryKey(),
|
||||||
|
resourcePolicyId: integer("resourcePolicyId")
|
||||||
|
.references(() => resourcePolicies.resourcePolicyId, { onDelete: "cascade" }),
|
||||||
resourceGuid: varchar("resourceGuid", { length: 36 })
|
resourceGuid: varchar("resourceGuid", { length: 36 })
|
||||||
.unique()
|
.unique()
|
||||||
.notNull()
|
.notNull()
|
||||||
@@ -567,7 +569,10 @@ export const resourceWhitelist = pgTable("resourceWhitelist", {
|
|||||||
email: varchar("email").notNull(),
|
email: varchar("email").notNull(),
|
||||||
resourceId: integer("resourceId")
|
resourceId: integer("resourceId")
|
||||||
.notNull()
|
.notNull()
|
||||||
.references(() => resources.resourceId, { onDelete: "cascade" })
|
.references(() => resources.resourceId, { onDelete: "cascade" }),
|
||||||
|
resourcePolicyId: integer("resourcePolicyId")
|
||||||
|
.notNull()
|
||||||
|
.references(() => resourcePolicies.resourcePolicyId, { onDelete: "cascade" }),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const resourceOtp = pgTable("resourceOtp", {
|
export const resourceOtp = pgTable("resourceOtp", {
|
||||||
@@ -575,6 +580,9 @@ export const resourceOtp = pgTable("resourceOtp", {
|
|||||||
resourceId: integer("resourceId")
|
resourceId: integer("resourceId")
|
||||||
.notNull()
|
.notNull()
|
||||||
.references(() => resources.resourceId, { onDelete: "cascade" }),
|
.references(() => resources.resourceId, { onDelete: "cascade" }),
|
||||||
|
resourcePolicyId: integer("resourcePolicyId")
|
||||||
|
.notNull()
|
||||||
|
.references(() => resourcePolicies.resourcePolicyId, { onDelete: "cascade" }),
|
||||||
email: varchar("email").notNull(),
|
email: varchar("email").notNull(),
|
||||||
otpHash: varchar("otpHash").notNull(),
|
otpHash: varchar("otpHash").notNull(),
|
||||||
expiresAt: bigint("expiresAt", { mode: "number" }).notNull()
|
expiresAt: bigint("expiresAt", { mode: "number" }).notNull()
|
||||||
|
|||||||
Reference in New Issue
Block a user