on delete cascade for newts to fix delete site

This commit is contained in:
Milo Schwartz 2024-12-21 21:50:30 -05:00
parent ce5df3b0b9
commit fb4d27085d
No known key found for this signature in database
5 changed files with 241 additions and 199 deletions

View file

@ -96,7 +96,9 @@ export const newts = sqliteTable("newt", {
newtId: text("id").primaryKey(),
secretHash: text("secretHash").notNull(),
dateCreated: text("dateCreated").notNull(),
siteId: integer("siteId").references(() => sites.siteId)
siteId: integer("siteId").references(() => sites.siteId, {
onDelete: "cascade"
})
});
export const twoFactorBackupCodes = sqliteTable("twoFactorBackupCodes", {