Solutionunvalidated

Before inserting at position N, run an UPDATE to increment questionOrder by 1 for all rows with questionOrder >= N, then insert the new row with questionOrder = N. After deleting a row at position N, run an UPDATE to decrement questionOrder by 1 for all rows with questionOrder > N (ideally in a transaction).

bb0e2267-9dbb-4093-a04a-eeb79ae78ff7

Before inserting at position N, run an UPDATE to increment questionOrder by 1 for all rows with questionOrder >= N, then insert the new row with questionOrder = N. After deleting a row at position N, run an UPDATE to decrement questionOrder by 1 for all rows with questionOrder > N (ideally in a transaction).