From 5b65c5c3695427e334d08f453a1d2f471a4a73cc Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 26 May 2016 00:56:05 +0100 Subject: RepoId isn't part of the primary key --- gentoobrowse-api/service/maintenanceimpl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gentoobrowse-api/service/maintenanceimpl.cpp b/gentoobrowse-api/service/maintenanceimpl.cpp index c2629fe..4ac065c 100644 --- a/gentoobrowse-api/service/maintenanceimpl.cpp +++ b/gentoobrowse-api/service/maintenanceimpl.cpp @@ -102,8 +102,8 @@ namespace Gentoo { void Maintenance::fileChanged(DB::Connection * dbc, const FileProcessors * fps, const boost::filesystem::path & tmp, DB::SelectCommandPtr s) { - // a.filename, a.repoid, a.filesize old_filesize, a.filetypeid old_filetypeid, a.moddate old_moddate, a.pathparts old_pathparts, b.filesize new_filesize, b.filetypeid new_filetypeid, b.moddate new_moddate, b.pathparts new_pathparts - s->forEachRow([dbc,&tmp,this,fps](auto fn, auto, auto, auto ft, auto, auto, auto, auto, auto, auto) { + // a.filename, a.filesize old_filesize, a.filetypeid old_filetypeid, a.moddate old_moddate, a.pathparts old_pathparts,a.repoid old_repoid, b.filesize new_filesize, b.filetypeid new_filetypeid, b.moddate new_moddate, b.pathparts new_pathparts, b.repoid new_repoid + s->forEachRow([dbc,&tmp,this,fps](auto fn, auto, auto ft, auto, auto, auto, auto, auto, auto, auto, auto) { this->fileHandle(ft, fps, boost::bind(&FileProcessor::modified, _1, dbc, fn, tmp / fn)); }); } @@ -161,7 +161,7 @@ namespace Gentoo { DB::TablePatch tp; tp.srcExpr = &src; tp.dest = "gentoobrowse.files"; - tp.pk = {"repoid", "filename"}; + tp.pk = {"filename"}; tp.cols = {"repoid", "filename", "filetypeid", "pathparts", "filesize", "moddate"}; tp.beforeDelete = boost::bind(&Maintenance::fileDeleted, this, dbc, &fps, tmp, _1); tp.beforeUpdate = boost::bind(&Maintenance::fileChanged, this, dbc, &fps, tmp, _1); -- cgit v1.2.3