Ignition cleared an index field on a 7 year old table

I was doing some testing with data logging in Ignition and it cleared, wiped out, nulled, the index column for a 7 year old table. It’s a table FactorySQL has been logging to. A few minutes with Ignition and there are nothing but nulls now. I’m not a SQL expert. Any suggestions on fixing it??

How would it possibly do that? The column must have somehow been mapped to an item or something… but then… any auto-increment field is usually required to be not-null by the database, so now I really can’t understand how this could happen.

Besides restoring from a backup, I don’t have any good ideas. Is this key something that you can more or less derive? In other words, is it an incrementing number, and the table also has a timestamp or something?

Regards,

If there are no other FOREIGN KEYS pointing to this table, you could add the column back in and let it auto-populate the values for you:

MySQL:

ALTER TABLE *YOUR_TABLE* DROP COLUMN id

ALTER TABLE *YOUR_TABLE*
ADD id INT NOT NULL AUTO_INCREMENT, ADD PRIMARY KEY(id)

MS SQL:

ALTER TABLE *YOUR_TABLE* DROP COLUMN id

ALTER TABLE *YOUR_TABLE*
ADD id INT NOT NULL IDENTITY(1,1)

As a protection measure, once I have my database all set up, I limit the privileges that the database user Ignition can have over the database to prevent these types of things.
I allow only the bare minimum privileges for each table.