feat(rfid): added tables to the db for tags and readers
This commit is contained in:
20
database/migrations/0015_wonderful_lady_vermin.sql
Normal file
20
database/migrations/0015_wonderful_lady_vermin.sql
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
CREATE TABLE "rfidReaders" (
|
||||||
|
"rfidReader_id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"reader" text,
|
||||||
|
"readerIP" text,
|
||||||
|
"lastHeartBeat" timestamp DEFAULT now()
|
||||||
|
);
|
||||||
|
--> statement-breakpoint
|
||||||
|
CREATE TABLE "rfidTags" (
|
||||||
|
"rfidTag_id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"tagHex" text,
|
||||||
|
"tag" text,
|
||||||
|
"timeStamp" timestamp DEFAULT now(),
|
||||||
|
"counts" jsonb NOT NULL,
|
||||||
|
"lastareaIn" text NOT NULL,
|
||||||
|
"runningNumber" numeric NOT NULL,
|
||||||
|
"created_at" timestamp DEFAULT now()
|
||||||
|
);
|
||||||
|
--> statement-breakpoint
|
||||||
|
CREATE UNIQUE INDEX "reader" ON "rfidReaders" USING btree ("reader");--> statement-breakpoint
|
||||||
|
CREATE UNIQUE INDEX "tagHex" ON "rfidTags" USING btree ("tagHex");
|
||||||
1033
database/migrations/meta/0015_snapshot.json
Normal file
1033
database/migrations/meta/0015_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -106,6 +106,13 @@
|
|||||||
"when": 1741892067501,
|
"when": 1741892067501,
|
||||||
"tag": "0014_illegal_thundra",
|
"tag": "0014_illegal_thundra",
|
||||||
"breakpoints": true
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idx": 15,
|
||||||
|
"version": "7",
|
||||||
|
"when": 1741952150913,
|
||||||
|
"tag": "0015_wonderful_lady_vermin",
|
||||||
|
"breakpoints": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
3
server/services/rfid/controller/mgtMonitor.ts
Normal file
3
server/services/rfid/controller/mgtMonitor.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
/**
|
||||||
|
* While in production we will monitor the readers if we have not gotten a heartbeat in the last 5 min we will send a reboot command along with an email.
|
||||||
|
*/
|
||||||
Reference in New Issue
Block a user