Use all types of migrations in devstack installation
For the moment we install Manila database using only 'upgrade' migrations. In that case we do not test Manila after using 'downgrade' migrations. So, allow enabling of both types of migrations to verify that our downgrade migrations do not break the world of data having functional tests running after it. Change-Id: If55a38692abca5e008095eb99b55adb465cad2b6
This commit is contained in:
parent
503203e243
commit
35300fc4e6
@ -37,6 +37,8 @@ driver_handles_share_servers=$(trueorfalse True driver_handles_share_servers)
|
||||
echo "MANILA_OPTGROUP_london_driver_handles_share_servers=$driver_handles_share_servers" >> $localrc_path
|
||||
echo "MANILA_OPTGROUP_paris_driver_handles_share_servers=$driver_handles_share_servers" >> $localrc_path
|
||||
|
||||
echo "MANILA_USE_DOWNGRADE_MIGRATIONS=True" >> $localrc_path
|
||||
|
||||
# JOB_NAME is defined in openstack-infra/config project
|
||||
# used by CI/CD, where this script is intended to be used.
|
||||
if [[ "$JOB_NAME" =~ "multibackend" ]]; then
|
||||
|
@ -79,6 +79,12 @@ MANILA_ENABLED_SHARE_PROTOCOLS=${ENABLED_SHARE_PROTOCOLS:-"NFS,CIFS"}
|
||||
MANILA_SCHEDULER_DRIVER=${MANILA_SCHEDULER_DRIVER:-manila.scheduler.filter_scheduler.FilterScheduler}
|
||||
MANILA_SERVICE_SECGROUP="manila-service"
|
||||
|
||||
# Following env var defines whether to apply downgrade migrations setting up DB or not.
|
||||
# If it is set to False, then only 'upgrade' migrations will be applied.
|
||||
# If it is set to True, then will be applied 'upgrade', 'downgrade' and 'upgrade'
|
||||
# migrations again.
|
||||
MANILA_USE_DOWNGRADE_MIGRATIONS=${MANILA_USE_DOWNGRADE_MIGRATIONS:-"False"}
|
||||
|
||||
# Common info for Generic driver(s)
|
||||
SHARE_DRIVER=${SHARE_DRIVER:-manila.share.drivers.generic.GenericShareDriver}
|
||||
|
||||
@ -466,8 +472,16 @@ function init_manila {
|
||||
if is_service_enabled $DATABASE_BACKENDS; then
|
||||
# (re)create manila database
|
||||
recreate_database manila utf8
|
||||
|
||||
$MANILA_BIN_DIR/manila-manage db sync
|
||||
|
||||
if [[ $(trueorfalse False MANILA_USE_DOWNGRADE_MIGRATIONS) == True ]]; then
|
||||
# Use both - upgrade and downgrade migrations to verify that
|
||||
# downgrade migrations do not break structure of Manila database.
|
||||
$MANILA_BIN_DIR/manila-manage db downgrade
|
||||
$MANILA_BIN_DIR/manila-manage db sync
|
||||
fi
|
||||
|
||||
# Display version as debug-action (see bug/1473400)
|
||||
$MANILA_BIN_DIR/manila-manage db version
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user