As pointed out by ezyang who currently works on the Mercurial backend, the 'revision' column in {versioncontrol_commits} doesn't have an index but should have one. I'm running out of time for today, so let's post this as an issue and come back to it later.

CommentFileSizeAuthor
#1 versioncontrol-revision-key.patch728 bytesezyang

Comments

ezyang’s picture

Component: Code » API module
Assigned: Unassigned » ezyang
Status: Active » Needs review
StatusFileSize
new728 bytes

Attached is a patch that adds a regular KEY to the column. However, I think a UNIQUE KEY on repo_id and revision would be more useful (after all, commits are unique to a repository). This means putting repo_id in the commits table, though.

jpetso’s picture

Assigned: ezyang » jpetso
Status: Needs review » Needs work

I want to get the 5.x-1.0 out of the door, so for that one we'll have the simple solution with just an added key. For the upcoming database changes, {versioncontrol_commits} will be merged into {versioncontrol_operations}, so we can get our unique key back (this time also including the 'type' column in it, of course).

The change to add the key is trivial (for Postgres as well, which is not taken into account in the above patch), the real work (but not all too much either) is in the upgrade function. Let me come up with that after the pizza baguette which should be ready by now.

jpetso’s picture

Status: Needs work » Fixed

Fixed in commit 100219, to be released with versioncontrol 5.x-1.0.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

  • Commit 08306ec on 5.x-1.x, 5.x-2.x, 6.x-1.x, repository-families, drush-vc-sync-unlock by jpetso:
    #216382: Create an index for the 'revision' column in {...

  • Commit 08306ec on 5.x-1.x, 5.x-2.x, 6.x-1.x, repository-families by jpetso:
    #216382: Create an index for the 'revision' column in {...