feat(readers): added in good and bad reads to monitor eff

This commit is contained in:
2025-07-10 20:06:31 -05:00
parent 1a6a05112b
commit c0ede8714c
6 changed files with 4366 additions and 0 deletions

View File

@@ -0,0 +1 @@
ALTER TABLE "rfidTags" RENAME COLUMN "timeStamp" TO "lastRead";

View File

@@ -0,0 +1,2 @@
ALTER TABLE "rfidReaders" ADD COLUMN "goodReads" integer DEFAULT 0;--> statement-breakpoint
ALTER TABLE "rfidReaders" ADD COLUMN "badReads" integer DEFAULT 0;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -477,6 +477,20 @@
"when": 1749744049457, "when": 1749744049457,
"tag": "0067_shallow_trish_tilby", "tag": "0067_shallow_trish_tilby",
"breakpoints": true "breakpoints": true
},
{
"idx": 68,
"version": "7",
"when": 1752195741709,
"tag": "0068_last_caretaker",
"breakpoints": true
},
{
"idx": 69,
"version": "7",
"when": 1752195894698,
"tag": "0069_chemical_maximus",
"breakpoints": true
} }
] ]
} }

View File

@@ -8,6 +8,7 @@ import {
uuid, uuid,
uniqueIndex, uniqueIndex,
jsonb, jsonb,
integer,
} from "drizzle-orm/pg-core"; } from "drizzle-orm/pg-core";
import { createInsertSchema, createSelectSchema } from "drizzle-zod"; import { createInsertSchema, createSelectSchema } from "drizzle-zod";
import { z } from "zod"; import { z } from "zod";
@@ -23,6 +24,8 @@ export const rfidReaders = pgTable(
lastTriggerGood: boolean("lastTiggerGood").default(true), lastTriggerGood: boolean("lastTiggerGood").default(true),
active: boolean("active").default(true), active: boolean("active").default(true),
lastTagScanned: text("lastTagScanned"), lastTagScanned: text("lastTagScanned"),
goodReads: integer("goodReads").default(0),
badReads: integer("badReads").default(0),
}, },
(table) => [ (table) => [
// uniqueIndex('emailUniqueIndex').on(sql`lower(${table.email})`), // uniqueIndex('emailUniqueIndex').on(sql`lower(${table.email})`),