| 78 | rodolico | 1 | select
 | 
        
           |  |  | 2 |    attribute_category.name category,
 | 
        
           |  |  | 3 |    attribute.name attribute,
 | 
        
           |  |  | 4 |    attribute_value.value
 | 
        
           |  |  | 5 | from
 | 
        
           |  |  | 6 |    attribute_value
 | 
        
           |  |  | 7 |    join attribute using (attribute_id)
 | 
        
           |  |  | 8 |    join attribute_category using (attribute_category_id)
 | 
        
           |  |  | 9 | where 
 | 
        
           |  |  | 10 |    1=1
 | 
        
           |  |  | 11 |    and attribute.display_in_summary
 | 
        
           |  |  | 12 |    and attribute_value.removed is null
 | 
        
           |  |  | 13 |    and entity_id = 164
 | 
        
           |  |  | 14 |    and _base_class_id = 3
 | 
        
           |  |  | 15 | order by
 | 
        
           |  |  | 16 |    attribute_category.sort_order,
 | 
        
           |  |  | 17 |    attribute_category.name,
 | 
        
           |  |  | 18 |    attribute.sort_order,
 | 
        
           |  |  | 19 |    attribute.name,
 | 
        
           |  |  | 20 |    attribute_value.value
 | 
        
           |  |  | 21 | ;
 | 
        
           |  |  | 22 |   | 
        
           |  |  | 23 |   | 
        
           |  |  | 24 |   | 
        
           |  |  | 25 |   | 
        
           |  |  | 26 |   | 
        
           |  |  | 27 | Block Devices
 | 
        
           |  |  | 28 | Memory
 | 
        
           |  |  | 29 | CPU
 | 
        
           |  |  | 30 | Physical
 | 
        
           |  |  | 31 | General (Note, Alias, Operating System, Location)
 | 
        
           |  |  | 32 |   | 
        
           |  |  | 33 |   | 
        
           |  |  | 34 |   | 
        
           |  |  | 35 | insert into attribute_category (name,sort_order) values ( 'General', 10 );
 | 
        
           |  |  | 36 | insert into attribute_category (name,sort_order) values ( 'Block Devices', 50 );
 | 
        
           |  |  | 37 | insert into attribute_category (name,sort_order) values ( 'Memory', 40 );
 | 
        
           |  |  | 38 | insert into attribute_category (name,sort_order) values ( 'Processor', 30  );
 | 
        
           |  |  | 39 | insert into attribute_category (name,sort_order) values ( 'Physical', 20 );
 | 
        
           |  |  | 40 |   | 
        
           |  |  | 41 | update attribute set attribute_category_id = (select attribute_category_id from attribute_category where name = 'Block Devices' ) where name like '/dev/%';
 | 
        
           |  |  | 42 | update attribute set attribute_category_id = (select attribute_category_id from attribute_category where name = 'Power' ) where name like 'Power%';
 | 
        
           |  |  | 43 | update attribute set attribute_category_id = (select attribute_category_id from attribute_category where name = 'Memory' ) where name like 'Memory%';
 | 
        
           |  |  | 44 | update attribute set attribute_category_id = (select attribute_category_id from attribute_category where name = 'Processor' ) where name like 'CPU%';
 | 
        
           |  |  | 45 | update attribute set attribute_category_id = (select attribute_category_id from attribute_category where name = 'Processor' ) where name like 'Enclosure%' or name like 'Firmware%' or name = 'Manufacturer' or name = 'Model' or name = 'Serial Number' or name = 'UUID';
 | 
        
           |  |  | 46 |   | 
        
           |  |  | 47 |   | 
        
           |  |  | 48 | alter table attribute add sort_order int unsigned not null default 100;
 | 
        
           |  |  | 49 |   | 
        
           |  |  | 50 | update attribute_category set sort_order = 10 where name = 'General';
 | 
        
           |  |  | 51 | update attribute_category set sort_order = 50 where name = 'Block Devices';
 | 
        
           |  |  | 52 | update attribute_category set sort_order = 40 where name = 'Memory';
 | 
        
           |  |  | 53 | update attribute_category set sort_order = 30 where name = 'Processor';
 | 
        
           |  |  | 54 | update attribute_category set sort_order = 20 where name = 'Physical';
 | 
        
           |  |  | 55 |   |