I have the following SQLite db:
sqlite> .schema
...
CREATE TABLE history (
date_created DATETIME,
date_updated DATETIME,
id INTEGER NOT NULL,
...
PRIMARY KEY (id),
FOREIGN KEY ... ,
...
);
...
sqlite> SELECT * FROM pragma_table_info('history');
0|date_created|DATETIME|0||0
1|date_updated|DATETIME|0||0
2|id|INTEGER|1||1
...
Even though the primary key is id
, doing a query on it leads to duplicate values:
sqlite> select rowid, id, date_updated from history;
...
499|499|2021-03-12 18:45:46.433
500|500|2021-03-12 18:47:49.616
501|501|2021-03-12 18:47:50.322
500|500|2021-03-12 19:37:14.320
501|501|2021-03-12 19:37:15.153
Total row count also somehow 503.
How can this even be possible? I have a server running on SQLAlchemy to use this DB, if that makes any difference.