<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">>> I was trying to streamline the whole process and I felt the need to have the snapshot as a separate entity just like a reg_entry or a reg_portgroup is, that is, "registry::snapshot" with a bunch of functions like create, get, list_all etc. I think this might help in writing the whole thing from a higher Tcl level.<br>
>> But then again, a snapshot is not something coming directly from the database, so I'm not sure how to keep it. Can I get your view on this?<br>
><br>
> Well, you already know that my view is that it would be far simpler to store the snapshots as a text-based format, rather than write and modify a large amount of non-trivial C.<br>
><br>
> But if you are set on doing this in the sqlite database, the relational way of doing it would be to add:<br>
><br>
> 1. A table of snapshots, consisting minimally of names and ids<br>
> 2. A table associating snapshot ids with port ids on a many-to-many basis<br>
<br>
</span>The snapshot tables would not be updated. I see no reason for a many to many. Each port/variant in a snapshot would have a snapshot id. When a snapshot is deleted delete it’s id everywhere.<br></blockquote><div><br></div><div>It is simply a one-to-many foreign key, that is, linking one snapshot to many port ids and further, one port to many variants.</div><div><br></div><div>Speaking of deleting a snapshot, do we want to limit the number of snapshots a user can have? or something like keeping an expiry date for a snapshot.</div><div><br></div><div>- Umesh</div></div></div></div>