Data migration code to set the deleted field to 0
The field does not have a default value. This caused a subcloud cannot be unmanaged after an upgrade. Test in a simulated environment: Reproduced the issue with manually setting deleted filed to Null. Deleted the subcloud_status record with endpoint dc-cert to simulate pre-upgrade env, run the sql script to simulate upgrade data migration. Was able to successfully unmanage the subcloud after. Change-Id: I4195c1901345c27d10b9dea59ee3f7acb9b1cd12 Story: 2007347 Task: 40113 Signed-off-by: Bin Qian <bin.qian@windriver.com>
This commit is contained in:
@@ -106,8 +106,8 @@ def update_subcloud_status():
|
||||
LOG.info("Nothing to do - load status records already exist.")
|
||||
|
||||
cur.execute("INSERT into subcloud_status("
|
||||
"subcloud_id, endpoint_type, sync_status) "
|
||||
"select id, 'dc-cert', 'in-sync' "
|
||||
"subcloud_id, endpoint_type, sync_status, deleted) "
|
||||
"select id, 'dc-cert', 'in-sync', 0 "
|
||||
"from subclouds where id not in "
|
||||
"(select subcloud_id from subcloud_status "
|
||||
"where endpoint_type = 'dc-cert')")
|
||||
|
||||
Reference in New Issue
Block a user