X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=trunk%2Fmigrations%2F006-up-slice-attribute-nodegroup.sql;fp=trunk%2Fmigrations%2F006-up-slice-attribute-nodegroup.sql;h=801f2a0071e89b6cb77663e59d48b45bb3b0d555;hb=5a4c1b1278ffa01e630fde47f7c54888ed20a576;hp=0000000000000000000000000000000000000000;hpb=cee5ab52df1c9f38b6eaff2dd354cb22f59028c7;p=plcapi.git diff --git a/trunk/migrations/006-up-slice-attribute-nodegroup.sql b/trunk/migrations/006-up-slice-attribute-nodegroup.sql new file mode 100644 index 0000000..801f2a0 --- /dev/null +++ b/trunk/migrations/006-up-slice-attribute-nodegroup.sql @@ -0,0 +1,29 @@ +---------- creations + +ALTER TABLE slice_attribute ADD nodegroup_id integer REFERENCES nodegroups; + +CREATE INDEX slice_attribute_nodegroup_id_idx ON slice_attribute (nodegroup_id); + +---------- view changes + +DROP VIEW view_slice_attributes; + +CREATE OR REPLACE VIEW view_slice_attributes AS +SELECT +slice_attribute.slice_attribute_id, +slice_attribute.slice_id, +slice_attribute.node_id, +slice_attribute.nodegroup_id, +slice_attribute_types.attribute_type_id, +slice_attribute_types.name, +slice_attribute_types.description, +slice_attribute_types.min_role_id, +slice_attribute.value +FROM slice_attribute +INNER JOIN slice_attribute_types USING (attribute_type_id); + + +---------- bump subversion + +UPDATE plc_db_version SET subversion = 6; +SELECT subversion from plc_db_version;