RE: Re: [viewvc-users] The root
"C. Michael Pilato" <[email protected]> Sat, 19 Jan 2013 01:48:06 -0500
| Newsgroups | gmane.comp.version-control.cvs.viewcvs.user |
|---|---|
| Message-ID | <[email protected]> |
Are you sure? Let's walk the dependencies backwards. If you were to remove a row from "repositories" you'd have dangling references to that repositoryid from the "checkins" and "tags" tables. So you'd want to remove rows from those tables which depend on that repositoryid. But no other tables have foreignkeys from "checkins" or "tags", right? So you wouldn't be *forced* to clean up anything else. Ah... perhaps you're saying that you'd need all that other purging just to be thorough. I think that's true in the general case, but not in this one. Why? Because for ViewVC is really only using those other tables as space savers -- it's sharing entries across repositories. IIRC there is only one row in the "files" table for all files named "README" across all repositories, for example. So to fully purge rows from those other tables that you don't need, you'd have to drop all and only those which are only referred to by the checkins and tags you also dropped and not from any which were not dropped. But in your situation the errant repository is just a duplicate of another repository. While each repository would have unique checkins and tags, I believe you'll find that everything else is shared by (at least) those two repositories. After all, its the same data set: same directories, same files, same branches, etc. In other words, there should be no data in those other tables which is unique to the repository you are purging. I'm replying on a smartphone at an awful hour, so don't hold me to this, but I suspect a reading of lib/cvsdb.py will confirm it. Dan Peterson <[email protected]> wrote: >On 01/17/2013 01:55 PM, C. Michael Pilato wrote: > >> If I'm reading the schema correctly (founding in the 'make-database' >> script), though -- and that's a non-trivially-sized "if" -- the >dependency >> chain ends there, and you could remove the offending row from >"repositories" >> plus any rows in "tags" and "checkins" which refer to that >repositoryid. > >Unfortunately, I don't think it's quite that simple... it looks like >many of the fields in the "checkins" table are references to the other >tables. For instance the "checkins" table has a "branchid" field, >which must be a reference to the "branches" table. > >That means I'd need to find all entries in the "checkins" table with a >"repositoryid" for the 'XXX' repository and then from that set of >results, find all "branchids" and remove them from the "branches" >table. > >Would need to do the same thing for each of the "people" (whoid), >"dirs" (dirid), "files" (fileid) and "descs (descid) tables. > >Then I'd also need to look for records in the checkouts table where the >"repository" field matches 'XXX'. -- Sent from my Android phone with K-9 Mail. Please excuse my brevity. ------------------------------------------------------ http://viewvc.tigris.org/ds/viewMessage.do?dsForumId=4255&dsMessageId=3044555 To unsubscribe from this discussion, e-mail: [[email protected]].