mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-17 16:11:12 +02:00
2022-02-22 Fred Gleason <fredg@paravelsystems.com>
* Added a '--print-progress' switch to rddbmgr(8). Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Rivendell database management utility
|
||||
//
|
||||
// (C) Copyright 2018-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2018-2022 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
@@ -146,6 +146,10 @@ MainObject::MainObject(QObject *parent)
|
||||
db_mysql_engine=cmd->value(i);
|
||||
cmd->setProcessed(i,true);
|
||||
}
|
||||
if(cmd->key(i)=="--print-progress") {
|
||||
db_start_datetime=QDateTime::currentDateTime();
|
||||
cmd->setProcessed(i,true);
|
||||
}
|
||||
if(cmd->key(i)=="--set-schema") {
|
||||
set_schema=cmd->value(i).toInt(&ok);
|
||||
if((!ok)||(set_schema<=0)) {
|
||||
@@ -384,8 +388,16 @@ MainObject::MainObject(QObject *parent)
|
||||
}
|
||||
|
||||
|
||||
void MainObject::WriteSchemaVersion(int ver) const
|
||||
void MainObject::WriteSchemaVersion(int ver)
|
||||
{
|
||||
if(!db_start_datetime.isNull()) {
|
||||
QDateTime now=QDateTime::currentDateTime();
|
||||
fprintf(stderr,"%s : setting schema version %d [%lld secs]\n",
|
||||
now.toString("yyyy-MM-dd hh:mm:ss").toUtf8().constData(),
|
||||
ver,
|
||||
db_start_datetime.secsTo(now));
|
||||
db_start_datetime=now;
|
||||
}
|
||||
QString sql=QString("update `VERSION` set ")+
|
||||
QString::asprintf("`DB`=%d",ver);
|
||||
RDSqlQuery::apply(sql);
|
||||
|
Reference in New Issue
Block a user