overwriting every line in database with the same data
Steps to reproduce
change data in one colomn could only get the first line
click save
all posts will change to the same data as the first one. Just for that coloumn.
Debuging of sql call will be added soon.
the database viewer is not using primary key. So if the primary key has several columns thte database viewer isnot using them
Her is the SQL that ruined my database
update timeliste
set tid_inn = ‘2020-11-10 22:03:43’, km_inn = 99999
where brsted = 1
it should have been
update timeliste
set tid_inn = ‘2020-11-10 22:03:43’, km_inn = 99999
where brsted = 1
and kunde = 45
and id = 123
The primary key is made of 3 coloumns due to connection between 3 tables
those 3 that is in the where clause
I have found out by testing that if the table has severals coloumns the database viewer
is using the field in the primary key that is first in the in the view
example table has following coloumns Date, Id1, id2 and id1 and id2 is the primary key
And the view is id2, id1, date it uses id2 as reference for update
and if the view is id1, id2, date it uses id1 as reference
regardless of the primary key sequence that is id1 as first part of primary key and then id2