mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-11-25 23:00:21 +01:00
2018-07-05 Fred Gleason <fredg@paravelsystems.com>
* Added an 'ELR_LINES' table to the database. * Incremented the database version to 289. * Removed the 'RDSvc::serviceTableName()' method.
This commit is contained in:
@@ -223,16 +223,18 @@ void MainObject::PurgeElr()
|
||||
RDSqlQuery *q1;
|
||||
QDateTime dt=QDateTime(QDate::currentDate(),QTime::currentTime());
|
||||
|
||||
sql="select NAME,ELR_SHELFLIFE from SERVICES where ELR_SHELFLIFE>=0";
|
||||
sql=QString("select ")+
|
||||
"NAME,"+
|
||||
"ELR_SHELFLIFE "+
|
||||
"from SERVICES where "+
|
||||
"ELR_SHELFLIFE>=0";
|
||||
q=new RDSqlQuery(sql);
|
||||
while(q->next()) {
|
||||
QString tablename=q->value(0).toString()+"_SRT";
|
||||
tablename.replace(" ","_");
|
||||
sql=QString("delete from `")+tablename+"` where "+
|
||||
sql=QString("delete from ELR_LINES where ")+
|
||||
"SERVICE_NAME=\""+RDEscapeString(q->value(0).toString())+"\" && "+
|
||||
"EVENT_DATETIME<\""+
|
||||
dt.addDays(-q->value(1).toInt()).toString("yyyy-MM-dd")+" 00:00:00\"";
|
||||
q1=new RDSqlQuery(sql);
|
||||
delete q1;
|
||||
RDSqlQuery::apply(sql);
|
||||
}
|
||||
delete q;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user