Browse Source

2018-07-07 Fred Gleason <fredg@paravelsystems.com>

* 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.
pull/335/head
Fred Gleason 5 years ago
parent
commit
7cc4e2df57
  1. 6
      ChangeLog
  2. 18
      scripts/init_template_host.py
  3. 9
      utils/rddbmgr/updateschema.cpp

6
ChangeLog

@ -17079,3 +17079,9 @@
2018-07-02 Fred Gleason <fredg@paravelsystems.com>
* Removed 'RDAIRPLAY.INSTANCE' field from schema update/reversion
284 in rddbmgr(8).
2018-07-07 Fred Gleason <fredg@paravelsystems.com>
* 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.

18
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 <fredg@paravelsystems.com>
#
@ -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()

9
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;
}

Loading…
Cancel
Save