fix(fingerprint): set fingerprintId reference to null

This commit is contained in:
Varun Narravula
2026-01-20 10:57:12 -08:00
committed by Owen Schwartz
parent 3ce1afbcc9
commit e2e09527ec
2 changed files with 12 additions and 10 deletions

View File

@@ -803,11 +803,12 @@ export const currentFingerprint = pgTable("currentFingerprint", {
export const fingerprintSnapshots = pgTable("fingerprintSnapshots", {
snapshotId: serial("id").primaryKey(),
fingerprintId: integer("fingerprintId")
.references(() => currentFingerprint.fingerprintId, {
onDelete: "cascade"
})
.notNull(),
fingerprintId: integer("fingerprintId").references(
() => currentFingerprint.fingerprintId,
{
onDelete: "set null"
}
),
username: text("username"),
hostname: text("hostname"),

View File

@@ -512,11 +512,12 @@ export const currentFingerprint = sqliteTable("currentFingerprint", {
export const fingerprintSnapshots = sqliteTable("fingerprintSnapshots", {
snapshotId: integer("id").primaryKey({ autoIncrement: true }),
fingerprintId: integer("fingerprintId")
.references(() => currentFingerprint.fingerprintId, {
onDelete: "cascade"
})
.notNull(),
fingerprintId: integer("fingerprintId").references(
() => currentFingerprint.fingerprintId,
{
onDelete: "set null"
}
),
username: text("username"),
hostname: text("hostname"),