mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-17 16:11:12 +02:00
2022-09-20 Fred Gleason <fredg@paravelsystems.com>
* Changed the 'RECORDINGS.URL_PASSWORD' from 'varchar(64)' to 'text'. * Base64 encoded the contents of the 'RECORDINGS.URL_PASSWORD' field. * Incremented the database version to 358. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -41,6 +41,34 @@ bool MainObject::RevertSchema(int cur_schema,int set_schema,QString *err_msg)
|
||||
// NEW SCHEMA REVERSIONS GO HERE...
|
||||
|
||||
|
||||
//
|
||||
// Revert 358
|
||||
//
|
||||
if((cur_schema==358)&&(set_schema<cur_schema)) {
|
||||
sql=QString("select ")+
|
||||
"`ID`,"+ // 00
|
||||
"`URL_PASSWORD` " // 01
|
||||
"from `RECORDINGS`";
|
||||
q=new RDSqlQuery(sql);
|
||||
while(q->next()) {
|
||||
sql=QString("update `RECORDINGS` set ")+
|
||||
"`URL_PASSWORD`='"+
|
||||
RDEscapeString(QByteArray::fromBase64(q->value(1).toString().toUtf8()))+"' "+
|
||||
QString::asprintf("where `ID`=%u",q->value(0).toUInt());
|
||||
if(!RDSqlQuery::apply(sql,err_msg)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
delete q;
|
||||
sql=QString("alter table `RECORDINGS` ")+
|
||||
"modify column `URL_PASSWORD` varchar(64)";
|
||||
if(!RDSqlQuery::apply(sql,err_msg)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
WriteSchemaVersion(--cur_schema);
|
||||
}
|
||||
|
||||
//
|
||||
// Revert 357
|
||||
//
|
||||
|
Reference in New Issue
Block a user