diff --git a/ChangeLog b/ChangeLog index d40a0002..6d7ed1da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23851,3 +23851,11 @@ man page. 2022-12-23 Florent Peyraud * Fix pypad lib which crashed when ProcessNullUpdates!=0 in conffile +2022-12-23 Fred Gleason + * 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. diff --git a/lib/dbversion.h b/lib/dbversion.h index d1b7c0fd..aa1b0bae 100644 --- a/lib/dbversion.h +++ b/lib/dbversion.h @@ -24,7 +24,7 @@ /* * Current Database Version */ -#define RD_VERSION_DATABASE 365 +#define RD_VERSION_DATABASE 366 #endif // DBVERSION_H diff --git a/utils/rddbmgr/revertschema.cpp b/utils/rddbmgr/revertschema.cpp index cb0f6185..68821998 100644 --- a/utils/rddbmgr/revertschema.cpp +++ b/utils/rddbmgr/revertschema.cpp @@ -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_schemavalue(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...