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)
#[ $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(){
# 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
'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`;
__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