2022-12-23 Fred Gleason <fredg@paravelsystems.com>

* Added a 'not null' constraint to the 'RDAIRPLAY.PAUSE_ENABLED'
	field.
	* Changed the default value of the 'RDAIRPLAY.PAUSE_ENABLED' field
	from NULL to 'N'.
	* Incremented the database version to 366.
	* Fixed a bug in rddbmgr(8) that could throw a SQL error when
	creating a new database.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2022-12-23 13:27:23 -05:00
parent a9653327a7
commit 4616ba172d
5 changed files with 39 additions and 12 deletions

View File

@ -23851,3 +23851,11 @@
man page.
2022-12-23 Florent Peyraud <florent@draceo.fr>
* Fix pypad lib which crashed when ProcessNullUpdates!=0 in conffile
2022-12-23 Fred Gleason <fredg@paravelsystems.com>
* Added a 'not null' constraint to the 'RDAIRPLAY.PAUSE_ENABLED'
field.
* Changed the default value of the 'RDAIRPLAY.PAUSE_ENABLED' field
from NULL to 'N'.
* Incremented the database version to 366.
* Fixed a bug in rddbmgr(8) that could throw a SQL error when
creating a new database.

View File

@ -24,7 +24,7 @@
/*
* Current Database Version
*/
#define RD_VERSION_DATABASE 365
#define RD_VERSION_DATABASE 366
#endif // DBVERSION_H

View File

@ -41,6 +41,19 @@ bool MainObject::RevertSchema(int cur_schema,int set_schema,QString *err_msg)
// NEW SCHEMA REVERSIONS GO HERE...
//
// Revert 366
//
if((cur_schema==366)&&(set_schema<cur_schema)) {
sql=QString("alter table `RDAIRPLAY` ")+
"modify column `PAUSE_ENABLED` enum('N','Y')";
if(!RDSqlQuery::apply(sql,err_msg)) {
return false;
}
WriteSchemaVersion(--cur_schema);
}
//
// Revert 365
//

View File

@ -160,7 +160,7 @@ void MainObject::InitializeSchemaMap() {
global_version_map["3.4"]=317;
global_version_map["3.5"]=346;
global_version_map["3.6"]=347;
global_version_map["4.0"]=365;
global_version_map["4.0"]=366;
}

View File

@ -11330,16 +11330,6 @@ bool MainObject::UpdateSchema(int cur_schema,int set_schema,QString *err_msg)
"`DATA_MID_THUMB`="+RDEscapeBlob(mid_blob)+","+
"`DATA_SMALL_THUMB`="+RDEscapeBlob(small_blob)+" "+
QString::asprintf("where `ID`=%u",q->value(0).toUInt());
/*
sql=QString("update `FEED_IMAGES` set ")+
"`DATA_MID_THUMB`="+
RDEscapeBlob(RDIMResizeImage(q->value(1).toByteArray(),
RD_MID_THUMB_SIZE))+","+
"`DATA_SMALL_THUMB`="+
RDEscapeBlob(RDIMResizeImage(q->value(1).toByteArray(),
RD_SMALL_THUMB_SIZE))+" "+
QString::asprintf("where `ID`=%u",q->value(0).toUInt());
*/
if(!RDSqlQuery::apply(sql,err_msg)) {
return false;
}
@ -11356,6 +11346,22 @@ bool MainObject::UpdateSchema(int cur_schema,int set_schema,QString *err_msg)
WriteSchemaVersion(++cur_schema);
}
if((cur_schema<366)&&(set_schema>cur_schema)) {
sql=QString("update `RDAIRPLAY` set ")+
"`PAUSE_ENABLED`='N' where "+
"`PAUSE_ENABLED` is null";
if(!RDSqlQuery::apply(sql,err_msg)) {
return false;
}
sql=QString("alter table `RDAIRPLAY` ")+
"modify column `PAUSE_ENABLED` enum('N','Y') not null default 'N'";
if(!RDSqlQuery::apply(sql,err_msg)) {
return false;
}
WriteSchemaVersion(++cur_schema);
}
// NEW SCHEMA UPDATES GO HERE...