-- Optional guard device tracking for gate scanners.
-- Guards can be created before a device is known, then bound on first device use.
ALTER TABLE "VisitSession" ADD COLUMN "deviceId" TEXT;

CREATE UNIQUE INDEX "Guard_deviceId_key" ON "Guard"("deviceId");
CREATE INDEX "VisitSession_estateId_deviceId_idx" ON "VisitSession"("estateId", "deviceId");
