summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2016-05-26 00:56:05 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2016-05-26 00:56:05 +0100
commit76ca3a8e7959b14b748ef2de63525f63990c5855 (patch)
tree7e54f316ae9de4b45bd53e8666acb8fb0a285dbf
parentDump a copy of files too (diff)
downloadgentoobrowse-api-76ca3a8e7959b14b748ef2de63525f63990c5855.tar.bz2
gentoobrowse-api-76ca3a8e7959b14b748ef2de63525f63990c5855.tar.xz
gentoobrowse-api-76ca3a8e7959b14b748ef2de63525f63990c5855.zip
RepoId isn't part of the primary key
-rw-r--r--gentoobrowse-api/service/maintenanceimpl.cpp6
1 files 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<std::string, int64_t, int64_t, int64_t, boost::posix_time::ptime, std::string, int64_t, int64_t, boost::posix_time::ptime, std::string>([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<std::string, int64_t, int64_t, boost::posix_time::ptime, std::string, int64_t, int64_t, int64_t, boost::posix_time::ptime, std::string, int64_t>([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);