On Aug 20, 2013, at 2:33 PM, Chris Behrens <cbehr...@codestud.com>
wrote:

> For instances table, we want to make sure 'uuid' is unique.  But we can't put 
> a unique constraint on that alone.  If that instance gets deleted.. we should 
> be able to create another entry with the same uuid without a problem.  So we 
> need a unique constraint on uuid+deleted.  But if 'deleted' is only 0 or 1… 
> we can only have 1 entry deleted and 1 entry not deleted.  Using deleted=`id` 
> to mark deletion solves that problem.  You could use deleted_at… but 2 
> creates and deletes within the same second would not work. :)

This creates another problem if you ever need to delete this second instance, 
because now you have two with the same uuid and the same deleted status. 
'deleted_at' is slightly better, as the only place it would fail is if all of 
this happened within the same unit of precision for that time value.


-- Ed Leafe

_______________________________________________
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to