after I had quite some trouble with dm-is-list on production (table with > 10000 entries which had more then 100 double positions - no scope) I needed to change the implementation that I can set some unique constraints on position/scope which at least helps to keep my database consistence.
the patch allows these constraints and along I fixed the 'move :up/:down' to respect the scope. the behaviour of switching the scope without supplying a new position is now the same as inserting a new entry in that new scope, i.e. it will be put at the end of the list.
the tests got the unique constraints.
the problem with my big table was something with such update statements:
sql
UPDATE "items" SET "position" = "position" + 1 WHERE "position" BETWEEN 4 AND 7
where it looks like that these are split up into a sequence of several statements which could interfere with each other. I never managed to reproduce the error in a test case, but it was reproducable on production and the new implementation works.
regards Kristian
Created by kristian - 2009-06-07 10:27:54 UTC
Original Lighthouse ticket: http://datamapper.lighthouseapp.com/projects/20609/tickets/891
该提问来源于开源项目:datamapper/dm-core