diff --git a/ChangeLog b/ChangeLog index 74ab1abf..078622bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17079,3 +17079,9 @@ 2018-07-02 Fred Gleason * Removed 'RDAIRPLAY.INSTANCE' field from schema update/reversion 284 in rddbmgr(8). +2018-07-07 Fred Gleason + * Fixed a bug in rddbmgr(8) that caused the 'AUDIO_CARDS', + 'AUDIO_INPUTS' and 'AUDIO_OUTPUTS' table to be created with the + incorrect engine type when using '--modify'. + * Updated the 'init_template_host.py' script to work with + schema version 287. diff --git a/scripts/init_template_host.py b/scripts/init_template_host.py index e2e6069a..be0ac582 100755 --- a/scripts/init_template_host.py +++ b/scripts/init_template_host.py @@ -3,7 +3,7 @@ # init_template_host.py # # Initialize a template-only host profile so it can be used as a -# template. +# template. (Requires the 'mysql-connector-python' package). # # (C) Copyright 2018 Fred Gleason # @@ -90,13 +90,19 @@ if(len(q.fetchall()) != 1): q.close() # -# Write host record +# Write host records # +sql='update AUDIO_CARDS set ' +sql+='DRIVER=2,' +sql+='NAME="Dummy Template Card",' +sql+='INPUTS='+str(inputs)+',' +sql+='OUTPUTS='+str(outputs) +sql+=' where STATION_NAME="'+args.host+'" && CARD_NUMBER='+str(cardnum) +q=db.cursor() +q.execute(sql) +q.close() + sql='update STATIONS set ' -sql+='CARD'+str(cardnum)+'_DRIVER=2,' -sql+='CARD'+str(cardnum)+'_NAME="Dummy Template Card",' -sql+='CARD'+str(cardnum)+'_INPUTS='+str(inputs)+',' -sql+='CARD'+str(cardnum)+'_OUTPUTS='+str(outputs)+',' sql+='STATION_SCANNED="Y" where ' sql+='NAME="'+args.host+'"' q=db.cursor() diff --git a/utils/rddbmgr/updateschema.cpp b/utils/rddbmgr/updateschema.cpp index 4ed21e4e..6284d2e6 100644 --- a/utils/rddbmgr/updateschema.cpp +++ b/utils/rddbmgr/updateschema.cpp @@ -6766,7 +6766,8 @@ bool MainObject::UpdateSchema(int cur_schema,int set_schema,QString *err_msg) co "NAME char(64),"+ "INPUTS int not null default -1,"+ "OUTPUTS int not null default -1,"+ - "unique index STATION_NAME_IDX(STATION_NAME,CARD_NUMBER))"; + "unique index STATION_NAME_IDX(STATION_NAME,CARD_NUMBER))"+ + db_table_create_postfix; if(!RDSqlQuery::apply(sql,err_msg)) { return false; } @@ -6841,7 +6842,8 @@ bool MainObject::UpdateSchema(int cur_schema,int set_schema,QString *err_msg) co "LEVEL int not null default 0,"+ "TYPE int not null default 0," "MODE int not null default 0,"+ - "unique index STATION_NAME_IDX(STATION_NAME,CARD_NUMBER,PORT_NUMBER))"; + "unique index STATION_NAME_IDX(STATION_NAME,CARD_NUMBER,PORT_NUMBER))"+ + db_table_create_postfix; if(!RDSqlQuery::apply(sql,err_msg)) { return false; } @@ -6891,7 +6893,8 @@ bool MainObject::UpdateSchema(int cur_schema,int set_schema,QString *err_msg) co "CARD_NUMBER int not null,"+ "PORT_NUMBER int not null,"+ "LEVEL int not null default 0,"+ - "unique index STATION_NAME_IDX(STATION_NAME,CARD_NUMBER,PORT_NUMBER))"; + "unique index STATION_NAME_IDX(STATION_NAME,CARD_NUMBER,PORT_NUMBER))"+ + db_table_create_postfix; if(!RDSqlQuery::apply(sql,err_msg)) { return false; }