Change in ovirt-engine[master]: core: DB 3.0 to 3.1 upgrade

emesika at redhat.com emesika at redhat.com
Wed Jan 9 10:26:28 UTC 2013


Eli Mesika has submitted this change and it was merged.

Change subject: core: DB 3.0 to 3.1 upgrade
......................................................................


core: DB 3.0 to 3.1 upgrade

This patch fixes the following errors
1) psql:upgrade/03_01_0410_remove_image_templates_table.sql:2: ERROR:
constraint "image_templates_images" of relation "images" does not exist
2)psql:upgrade/03_01_0950_add_permissions_on_storage_to_users.sql:122:
ERROR:  duplicate key value violates unique constraint
"idx_combined_ad_role_object"

1) was solved by adding two functions fn_db_add/drop_constraint that
checks if constraint not exists/exists before attempting to add/drop it
Then all upgrade scripts adding/dropping table constraints were modified
to use those safe functions, this will ensure that in the next round we
will not got this type of errors anymore.

2) was solved by adding a missing check for duplicate key.

All changes are safe and not change functionality.

Change-Id: I7d0a37abb58f080338b3161d0694c8ba30217d99
Signed-off-by: Eli Mesika <emesika at redhat.com>
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=892532
---
M backend/manager/dbscripts/common_sp.sql
M backend/manager/dbscripts/upgrade/03_01_0100_migrate_templates_to_vm_static.sql
M backend/manager/dbscripts/upgrade/03_01_0300_vds_static_unique_fields.sql
M backend/manager/dbscripts/upgrade/03_01_0410_remove_image_templates_table.sql
M backend/manager/dbscripts/upgrade/03_01_0430_add_image_domain_map_table.sql
M backend/manager/dbscripts/upgrade/03_01_0500_add_unique_name_constraint.sql
M backend/manager/dbscripts/upgrade/03_01_0720_remove_unused_images_columns.sql
M backend/manager/dbscripts/upgrade/03_01_0950_add_permissions_on_storage_to_users.sql
M backend/manager/dbscripts/upgrade/03_01_1090_gluster_brick_option_id.sql
M backend/manager/dbscripts/upgrade/03_01_1260_remove_time_lease_vm_pool_map_table.sql
M backend/manager/dbscripts/upgrade/03_01_1520_add_fk_vm_interface_vm_static_template.sql
M backend/manager/dbscripts/upgrade/03_02_0270_gluster_volume_name_unique_constraint.sql
12 files changed, 52 insertions(+), 32 deletions(-)

Approvals:
  Eli Mesika: Verified; Looks good to me, approved


--
To view, visit http://gerrit.ovirt.org/10735
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7d0a37abb58f080338b3161d0694c8ba30217d99
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Eli Mesika <emesika at redhat.com>
Gerrit-Reviewer: Eli Mesika <emesika at redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzaslavs at redhat.com>



More information about the Engine-commits mailing list