I have a table with many lines and a column call "order" which goes from 1 to XX depends on how many line i have in my table.
The thing is, if i want to move the line with the "order" 1 to the position 3, i need the other "order" from other line to rearange themselves.
For example, if i move the "order" 1 with a "3", all the number after will have to increase of 1 and the second will have to be "order" 1 now.
I hope that i was clear.
Thanks for your help !
EDIT / SAMPLE DATA
Name | Order
Line 1 | 1
Line 2 | 2
Line 3 | 3
Line 4 | 4
If i update the order of "Line 1" with 4 instead of 1, i want the other to have their order update !
Name | Order
Line 2 | 1
Line 3 | 2
Line 4 | 3
Line 1 | 4
Same thing if i update the order of "line 4" with a 1 !
Name | Order
Line 4 | 1
Line 1 | 2
Line 2 | 3
Line 3 | 4
Same thing if i update the order of "line 3" with a 2 for example !
Name | Order
Line 1 | 1
Line 3 | 2
Line 2 | 3
Line 4 | 4