access position history after deleting and recreating a device

control taken 3 years ago

cordial greeting, I am writing because of a doubt that has arisen, due to certain actions that I have carried out and it is reflected in the mysql database, which is normal behavior as a SQL manager and is as follows.

when I delete a device for X or Y reason and when I add it again I cannot see the position history in the reports before having deleted it, it only allows me to see the route history since I added it again and the old position information remains there saved but no access to it.

What modification in the information in the tables should I do to access the id in the mysql tables again, which would allow me to access the position history before removing the device and re-adding it and recreating all the new positions stored with the old ones so as not to unnecessarily enlarge the database since every time I delete and recreate the same device regardless of whether it is the same IMEI, in the database it will have a new ID, which I am looking for to know in which tables I could modify this ID so as not to suffer any loss of access to positions and information that the GPS has previously sent.

I do not know if this question has been asked before, but in my search I could not find something similar successfully, any suggestion would be excellent to be able to solve these problems when I need to eliminate a device and add it again for any reason (the most common reason is due to because some gps stop sending coordinates or it takes a long time to connect and the fastest way is to delete them and add them back but on very few occasions it happens)

x688399 3 years ago

You could do some SQL changes to the database.
The field "id" in table "tc_devices" should correspond to the ID in the table "tc_positions".
You could do an update on either tables to change the id. The database ID is unique and does not reflect the "uniqueid" of the hardware device.