update query

This commit is contained in:
Pringgosutono
2026-02-10 07:41:27 +07:00
parent d7218baaa1
commit add661e8c9

View File

@ -43,7 +43,7 @@ async function job() {
CREATE TABLE ${tableName} ( CREATE TABLE ${tableName} (
id bigint NOT NULL AUTO_INCREMENT, id bigint NOT NULL AUTO_INCREMENT,
original_hex text, original_hex text,
protocol enum('gt06','tk119','smartphone') DEFAULT NULL, protocol enum('gt06','tk119','smartphone','teltonika8e','other') DEFAULT NULL,
action enum('login','heartbeat','location','alarm','other','teltonika8e') DEFAULT NULL, action enum('login','heartbeat','location','alarm','other','teltonika8e') DEFAULT NULL,
device_id varchar(16) DEFAULT NULL, device_id varchar(16) DEFAULT NULL,
latitude double DEFAULT NULL, latitude double DEFAULT NULL,
@ -138,7 +138,7 @@ async function job() {
const startOfMonth = histMonth.clone().startOf("month").unix() - TIMEFIX const startOfMonth = histMonth.clone().startOf("month").unix() - TIMEFIX
const endOfMonth = histMonth.clone().endOf("month").unix() - TIMEFIX const endOfMonth = histMonth.clone().endOf("month").unix() - TIMEFIX
console.log( console.log(
`Inserting data into history table '${histTableName}' for records from ${startOfMonth} to ${endOfMonth}` `Inserting data into history table '${histTableName}' for records from ${startOfMonth} to ${endOfMonth}`,
) )
const q2 = ` const q2 = `