Changes between Initial Version and Version 1 of Ticket #6947, comment 5


Ignore:
Timestamp:
Jul 4, 2013, 7:07:08 AM (11 years ago)
Author:
k_bx

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #6947, comment 5

    initial v1  
    1 Guys, I, as many others, use sqlite database to run local dev-server and for tests (production is running postgresql). I was writing test that needs to ensure that object is "recreated", so that it and it's foreign objects linking him are also recreated. As a first implementation (when I didn't know that pk can be reused in SQLite), what I did is to expect DoesNotExist error under old object's pk (which should be deleted). But now, since new one is created instead of that object, object under that pk is present in database.
     1Guys, I, as many others, use sqlite database to run local dev-server and for tests (production is running postgresql). I was writing test that needs to ensure that object is "recreated" (we decided to implement "edit" operation on complex object graph as first removing main object with it's dependencies and then re-creating main object with same pk, and then adding it's dependencies), so that it and it's foreign objects linking him are first removed, and then new one with same pk is created, and then new objects linking it are created (not setting their pk). As a first implementation (when I didn't know that pk can be reused in SQLite), what I did is to expect DoesNotExist error under old object's pk (which should be deleted). But now, since new one is created instead of that object, object under that pk is present in database.
    22
    33Guarantee that pk is not reused under AUTOINCREMENT (well, at least in tests, since not many people have so many objects in tests) is a really strong feature here, without which I'm not sure what ways to go better (how do you ensure that two objects are not the same if you're able to reuse pk's now?).
Back to Top