After some discuss on IRC, sdboyer and I came to the conclusion that it would be a good idea to join {versioncontrol_item_revisions} and {versioncontrol_source_items} tables.

Now:
- {versioncontrol_item_revisions} has one PK: item_revision_id
and
- {versioncontrol_source_items} has two: item_revision_id and source_item_revision_id.

Those two PKs let us support the joining of two items, but as we decide, it is not a really important thing to track as the abstract VCS API, so those tables will be merged.

Comments

marvil07’s picture

Status: Active » Needs review
StatusFileSize
new13.31 KB

Ok, here the schema change.

marvil07’s picture

the second version of this patch, it fix views integration to this change(but anyway there are some TODOs there also, so just getting to the same state) and one string change.

sdboyer’s picture

Looks pretty good. We can probably stand to drop the line_changes_recorded field - I don't see what its purpose is, really, its contents can be readily determined from other fields in the same record. Apart from that, if you could go through and check to see what in the rest of the project this touches, and make sure we haven't missed anything (as happened with #972058: Complete removing of {versioncontrol_operation_items} table), that'd be good - ignoring anything in controllers.inc and VersioncontrolItem.php.

marvil07’s picture

Ok, I just fix two queries that use the table at the module file: at versioncontrol_fetch_source_items() and at versioncontrol_fetch_source_items(), and I left the real-crud stuff untouched.

About line_changes_recorded, there is a description on the schema about it:

Specifies whether line-change information is available (1 as value) or not (0 as value). Naturally, this should only apply to file items, not to directory items. VERSIONCONTROL_ACTION_DELETED and VERSIONCONTROL_ACTION_REPLACED actions are also not supposed to contain line-change information.

So, I agree, it do not make real sense to repeat this information, now that we also have the type and the action fields in the same table, so this patch also removes it.

marvil07’s picture

Status: Needs review » Fixed

Ok, committed :-)

Status: Fixed » Closed (fixed)
Issue tags: -git phase 2, -git sprint 4

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

  • Commit d475efa on repository-families, drush-vc-sync-unlock by marvil07:
    task #975864: Merge {versioncontrol_item_revisions} and {...
  • Commit 8dd392f on repository-families, drush-vc-sync-unlock by sdboyer:
    Issue #879858 by sdboyer and marvil07: unify all VersioncontrolEntity...

  • Commit d475efa on repository-families by marvil07:
    task #975864: Merge {versioncontrol_item_revisions} and {...
  • Commit 8dd392f on repository-families by sdboyer:
    Issue #879858 by sdboyer and marvil07: unify all VersioncontrolEntity...