Eli Mesika has posted comments on this change.

Change subject: history: made several changes to vm disks tables
......................................................................


Patch Set 1: I would prefer that you didn't submit this

(2 inline comments)

....................................................
File 
data-warehouse/historydbscripts_postgres/upgrade/03_03_0030_change_vm_disks_tables.sql
Line 1: --drop old indexes on image_id
Line 2: DROP INDEX vm_disk_configuration_vm_disk_id_idx;
Line 3: DROP INDEX vm_disk_samples_history_vm_disk_id_idx;
Line 4: DROP INDEX vm_disk_hourly_history_vm_disk_id_idx;
Line 5: DROP INDEX vm_disk_daily_history_vm_disk_id_idx;
please use
DROP INDEX IF EXISTS
Line 6: 
Line 7: --change image_id to nullable and vm_disk_id to not nullable
Line 8: ALTER TABLE vm_disk_configuration ALTER COLUMN image_id DROP NOT NULL;
Line 9: ALTER TABLE vm_disk_samples_history ALTER COLUMN image_id DROP NOT NULL;


Line 18: 
Line 19: ALTER TABLE vm_disk_configuration ALTER COLUMN vm_disk_id SET NOT NULL;
Line 20: ALTER TABLE vm_disk_samples_history ALTER COLUMN vm_disk_id SET NOT 
NULL;
Line 21: ALTER TABLE vm_disk_hourly_history ALTER COLUMN vm_disk_id SET NOT 
NULL;
Line 22: ALTER TABLE vm_disk_daily_history ALTER COLUMN vm_disk_id SET NOT NULL;
This will not work
changing the default will affect only future insertion and setting to not null 
will fail if column has already null values
Line 23: 
Line 24: --now removing the default value
Line 25: ALTER TABLE vm_disk_configuration ALTER COLUMN vm_disk_id DROP DEFAULT;
Line 26: ALTER TABLE vm_disk_samples_history ALTER COLUMN vm_disk_id DROP 
DEFAULT;


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib4f01238d50a8bd21b4b08f5aa03b2c6c771df93
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-dwh
Gerrit-Branch: master
Gerrit-Owner: Yaniv Dary <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
Gerrit-Reviewer: Yaniv Dary <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to