From: Eduardo Sousa Date: Thu, 7 Feb 2019 10:53:10 +0000 (+0000) Subject: Re-adding the enum elements for SFC that were missing X-Git-Tag: v6.0.0~43 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F09%2F7209%2F3;p=osm%2FRO.git Re-adding the enum elements for SFC that were missing Change-Id: Ie198147ae914dc35445158489ad85f1156857782 Signed-off-by: Eduardo Sousa --- diff --git a/database_utils/migrate_mano_db.sh b/database_utils/migrate_mano_db.sh index 2d3f1bcf..b6867ffe 100755 --- a/database_utils/migrate_mano_db.sh +++ b/database_utils/migrate_mano_db.sh @@ -36,7 +36,7 @@ QUIET_MODE="" BACKUP_DIR="" BACKUP_FILE="" #TODO update it with the last database version -LAST_DB_VERSION=36 +LAST_DB_VERSION=37 # Detect paths MYSQL=$(which mysql) @@ -193,7 +193,8 @@ fi #[ $OPENMANO_VER_NUM -ge 5082 ] && DB_VERSION=33 #0.5.82 => 33 #[ $OPENMANO_VER_NUM -ge 6000 ] && DB_VERSION=34 #0.6.00 => 34 #[ $OPENMANO_VER_NUM -ge 6001 ] && DB_VERSION=35 #0.6.01 => 35 -#[ $OPENMANO_VER_NUM -ge 6003 ] && DB_VERSION=35 #0.6.03 => 36 +#[ $OPENMANO_VER_NUM -ge 6003 ] && DB_VERSION=36 #0.6.03 => 36 +#[ $OPENMANO_VER_NUM -ge 6009 ] && DB_VERSION=37 #0.6.09 => 37 #TODO ... put next versions here function upgrade_to_1(){ @@ -1346,6 +1347,21 @@ function downgrade_from_36(){ # For downgrade do not restore wims/wim_accounts config to varchar 4000 sql "DELETE FROM schema_version WHERE version_int='36';" } +function upgrade_to_37(){ + echo " Adding the enum tags for SFC" + sql "ALTER TABLE vim_wim_actions " \ + "MODIFY COLUMN item " \ + "ENUM('datacenters_flavors','datacenter_images','instance_nets','instance_vms','instance_interfaces'," \ + "'instance_sfis','instance_sfs','instance_classifications','instance_sfps','instance_wim_nets') " \ + "NOT NULL COMMENT 'table where the item is stored';" + sql "INSERT INTO schema_version (version_int, version, openmano_ver, comments, date) " \ + "VALUES (37, '0.37', '0.6.09', 'Adding the enum tags for SFC', '2019-02-07');" +} +function downgrade_from_37(){ + echo " Adding the enum tags for SFC isn't going to be reversed" + # It doesn't make sense to reverse to a bug state. + sql "DELETE FROM schema_version WHERE version_int='37';" +} #TODO ... put functions here diff --git a/database_utils/migrations/down/34_remove_wim_tables.sql b/database_utils/migrations/down/34_remove_wim_tables.sql index c6fa0b43..4400e39f 100644 --- a/database_utils/migrations/down/34_remove_wim_tables.sql +++ b/database_utils/migrations/down/34_remove_wim_tables.sql @@ -15,7 +15,11 @@ ALTER TABLE `vim_wim_actions` MODIFY `item` enum( 'datacenter_images', 'instance_nets', 'instance_vms', - 'instance_interfaces') NOT NULL + 'instance_interfaces', + 'instance_sfis', + 'instance_sfs', + 'instance_classifications', + 'instance_sfps') NOT NULL COMMENT 'table where the item is stored'; ALTER TABLE `vim_wim_actions` MODIFY `datacenter_vim_id` varchar(36) NOT NULL; ALTER TABLE `vim_wim_actions` DROP `wim_internal_id`, DROP `wim_account_id`; diff --git a/database_utils/migrations/up/34_add_wim_tables.sql b/database_utils/migrations/up/34_add_wim_tables.sql index 6c6fc335..343f370a 100644 --- a/database_utils/migrations/up/34_add_wim_tables.sql +++ b/database_utils/migrations/up/34_add_wim_tables.sql @@ -118,6 +118,10 @@ ALTER TABLE `vim_wim_actions` 'instance_nets', 'instance_vms', 'instance_interfaces', + 'instance_sfis', + 'instance_sfs', + 'instance_classifications', + 'instance_sfps', 'instance_wim_nets') NOT NULL COMMENT 'table where the item is stored'; ALTER TABLE `vim_wim_actions` diff --git a/openmanod b/openmanod index 47b4ec67..5dee02b5 100755 --- a/openmanod +++ b/openmanod @@ -50,9 +50,9 @@ import osm_ro __author__ = "Alfonso Tierno, Gerardo Garcia, Pablo Montes" __date__ = "$26-aug-2014 11:09:29$" -__version__ = "0.6.08" +__version__ = "0.6.09" version_date = "Feb 2019" -database_version = 36 # expected database schema version +database_version = 37 # expected database schema version global global_config global logger