Skip to content
This repository has been archived by the owner on Feb 24, 2022. It is now read-only.

Commit

Permalink
Add migration script from 9.2.5 to 9.3.3 (#18)
Browse files Browse the repository at this point in the history
* Define TangoRestServer in db upgrade scripts

* Rename db upgrade scripts to specify target version

* Add migration script from 9.2.5 to 9.3.3
  • Loading branch information
mliszcz authored and bourtemb committed Aug 5, 2019
1 parent 2be2ce6 commit 32e8a30
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 4 deletions.
9 changes: 5 additions & 4 deletions configure/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ set(DB_SCRIPTS create_db.sh
create_db_tables.sql
rem_history.sql
stored_proc.sql
update_db5.sql
update_db6.sql
update_db7.sql
update_db8.sql
update_db_from_5_to_9.3.3.sql
update_db_from_6_to_9.3.3.sql
update_db_from_7_to_9.3.3.sql
update_db_from_8_to_9.3.3.sql
update_db_from_9.2.5_to_9.3.3.sql
update_db.sh
update_db.sql)

Expand Down
8 changes: 8 additions & 0 deletions update_db5.sql.in → update_db_from_5_to_9.3.3.sql.in
Original file line number Diff line number Diff line change
Expand Up @@ -276,3 +276,11 @@ DROP PROCEDURE IF EXISTS tango.upd_history_ids;

source stored_proc.sql

#
# Create entry for TangoRestServer device server in device table
#

DELETE FROM device WHERE server='TangoRestServer/rest';

INSERT INTO device VALUES ('sys/rest/0',NULL,'sys','rest','0',0,'nada','nada','TangoRestServer/rest',0,'TangoRestServer','nada',NULL,NULL,'nada');
INSERT INTO device VALUES ('dserver/TangoRestServer/rest',NULL,'dserver','TangoRestServer','rest',0,'nada','nada','TangoRestServer/rest',0,'DServer','nada',NULL,NULL,'nada');
8 changes: 8 additions & 0 deletions update_db6.sql.in → update_db_from_6_to_9.3.3.sql.in
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,11 @@ INSERT INTO property_class VALUES ('TangoAccessControl','AllowedAccessCmd',6,'Ge

source stored_proc.sql

#
# Create entry for TangoRestServer device server in device table
#

DELETE FROM device WHERE server='TangoRestServer/rest';

INSERT INTO device VALUES ('sys/rest/0',NULL,'sys','rest','0',0,'nada','nada','TangoRestServer/rest',0,'TangoRestServer','nada',NULL,NULL,'nada');
INSERT INTO device VALUES ('dserver/TangoRestServer/rest',NULL,'dserver','TangoRestServer','rest',0,'nada','nada','TangoRestServer/rest',0,'DServer','nada',NULL,NULL,'nada');
9 changes: 9 additions & 0 deletions update_db7.sql.in → update_db_from_7_to_9.3.3.sql.in
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ ALTER TABLE device_attribute_history_id MODIFY id bigint unsigned NOT NULL defau
ALTER TABLE device_history_id MODIFY id bigint unsigned NOT NULL default '0';
ALTER TABLE object_history_id MODIFY id bigint unsigned NOT NULL default '0';

#
# Create entry for TangoRestServer device server in device table
#

DELETE FROM device WHERE server='TangoRestServer/rest';

INSERT INTO device VALUES ('sys/rest/0',NULL,'sys','rest','0',0,'nada','nada','TangoRestServer/rest',0,'TangoRestServer','nada',NULL,NULL,'nada');
INSERT INTO device VALUES ('dserver/TangoRestServer/rest',NULL,'dserver','TangoRestServer','rest',0,'nada','nada','TangoRestServer/rest',0,'DServer','nada',NULL,NULL,'nada');

#
# Create entries in the property_class tables for controlled access service
#
Expand Down
9 changes: 9 additions & 0 deletions update_db8.sql.in → update_db_from_8_to_9.3.3.sql.in
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ ALTER TABLE device_attribute_history_id MODIFY id bigint unsigned NOT NULL defau
ALTER TABLE device_history_id MODIFY id bigint unsigned NOT NULL default '0';
ALTER TABLE object_history_id MODIFY id bigint unsigned NOT NULL default '0';

#
# Create entry for TangoRestServer device server in device table
#

DELETE FROM device WHERE server='TangoRestServer/rest';

INSERT INTO device VALUES ('sys/rest/0',NULL,'sys','rest','0',0,'nada','nada','TangoRestServer/rest',0,'TangoRestServer','nada',NULL,NULL,'nada');
INSERT INTO device VALUES ('dserver/TangoRestServer/rest',NULL,'dserver','TangoRestServer','rest',0,'nada','nada','TangoRestServer/rest',0,'DServer','nada',NULL,NULL,'nada');

#
# Update entries in the property_class tables for controlled access service
#
Expand Down
17 changes: 17 additions & 0 deletions update_db_from_9.2.5_to_9.3.3.sql.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
USE @TANGO_DB_NAME@;

#
# Create entry for TangoRestServer device server in device table
#

DELETE FROM device WHERE server='TangoRestServer/rest';

INSERT INTO device VALUES ('sys/rest/0',NULL,'sys','rest','0',0,'nada','nada','TangoRestServer/rest',0,'TangoRestServer','nada',NULL,NULL,'nada');
INSERT INTO device VALUES ('dserver/TangoRestServer/rest',NULL,'dserver','TangoRestServer','rest',0,'nada','nada','TangoRestServer/rest',0,'DServer','nada',NULL,NULL,'nada');

#
# Update entries in the property_class tables for controlled access service
#

DELETE FROM property_class WHERE class='DServer' AND count >= 11;
INSERT INTO property_class VALUES('DServer','AllowedAccessCmd',11,'EventConfirmSubscription',NOW(),NOW(),NULL);

0 comments on commit 32e8a30

Please sign in to comment.