Subversion Repositories computer_asset_manager_v1

Rev

Rev 99 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 99 Rev 106
Line 92... Line 92...
92
   screen_report  int unsigned default null comment 'Each screen can be assigned a bit and this will show up on a screen',
92
   screen_report  int unsigned default null comment 'Each screen can be assigned a bit and this will show up on a screen',
93
   primary key    (report_id)
93
   primary key    (report_id)
94
) comment 'holds definition for report';
94
) comment 'holds definition for report';
95
 
95
 
96
/* create some keys */
96
/* create some keys */
97
alter table attrib add index (name);
-
 
98
alter table attrib add index (added_date,removed_date);
-
 
99
 
97
 
100
alter table device add index (added_date,removed_date);
98
alter table device add index (added_date,removed_date);
101
alter table device add index (part_of);
99
alter table device add index (part_of);
102
alter table device add index (removed_date);
100
alter table device add index (removed_date);
103
alter table device add index (site_id);
101
alter table device add index (site_id);
104
alter table device add index (name);
102
alter table device add index (name);
105
alter table device add index (device_type_id);
103
alter table device add index (device_type_id);
106
 
104
 
107
alter table device_attrib add index (device_id);
-
 
108
alter table device_attrib add index (added_date,removed_date);
-
 
109
 
-
 
110
alter table site add index (client_id);
105
alter table site add index (client_id);
111
alter table site add index (removed_date);
106
alter table site add index (removed_date);
112
 
107
 
113
alter table client add index (removed_date);
108
alter table client add index (removed_date);
114
 
109
 
Line 123... Line 118...
123
insert into report( name, query, parameters ) values ('Client Devices','select client.name,site.name,device.name
118
insert into report( name, query, parameters ) values ('Client Devices','select client.name,site.name,device.name
124
from current_client client join current_site site using (client_id) 
119
from current_client client join current_site site using (client_id) 
125
join current_device device using (site_id)
120
join current_device device using (site_id)
126
where client.client_id = <client_id>','client_id++Client++select client_id,name from current_client order by name++select name from current_client where client_id = <value>');
121
where client.client_id = <client_id>','client_id++Client++select client_id,name from current_client order by name++select name from current_client where client_id = <value>');
127
 
122
 
128
insert into report( name, query, parameters, screen_report ) values ('Device Attributes','select attrib.name "Attribute",device_attrib.value "Value" 
123
insert into report values (
-
 
124
   null,
129
         from device_attrib join attrib using (attrib_id) 
125
   'Virtuals on Hypervisor',
130
         where device_id = <device_id> and device_attrib.removed_date is null',
126
   'select device_id id,name Name from device where removed_date is null and device_id in (select device_id from device join device_type using (device_type_id) where part_of = <device_id> and device_type.show_as_system = \'Y\') order by name',
131
         'device_id++Device++select device_id,name from device where removed_date is null++select name from device where device_id = <value>', 1);
127
   'device_id++Device++select device_id,name from device where removed_date is null++select name from device where device_id = <value>',
-
 
128
   1
-
 
129
   );
-
 
130
 
132
 
131
 
133
 
132
 
134
/* base menu */
133
/* base menu */
135
insert into menu( url,caption,parent_id) values ('/index.html','Home Page',null);
134
insert into menu( url,caption,parent_id) values ('/index.html','Home Page',null);
136
insert into menu( url,caption,parent_id) values ('/reports.html','Reports',null);
135
insert into menu( url,caption,parent_id) values ('/reports.html','Reports',null);
Line 160... Line 159...
160
insert into device_type ( name, show_as_system, added_date ) values ( 'Router', 'Y', now() );
159
insert into device_type ( name, show_as_system, added_date ) values ( 'Router', 'Y', now() );
161
insert into device_type ( name, show_as_system, added_date ) values ( 'Switch', 'Y', now() );
160
insert into device_type ( name, show_as_system, added_date ) values ( 'Switch', 'Y', now() );
162
insert into device_type ( name, show_as_system, added_date ) values ( 'Network Printer', 'Y', now() );
161
insert into device_type ( name, show_as_system, added_date ) values ( 'Network Printer', 'Y', now() );
163
insert into device_type ( name, show_as_system, added_date ) values ( 'PCI Card', 'N', now() );
162
insert into device_type ( name, show_as_system, added_date ) values ( 'PCI Card', 'N', now() );
164
insert into device_type ( name, show_as_system, added_date ) values ( 'Periphial', 'N', now() );
163
insert into device_type ( name, show_as_system, added_date ) values ( 'Periphial', 'N', now() );
165
 
-
 
166
/* create some defaults for attrib */
-
 
167
insert into attrib (name,added_date) values ( 'Manufacturer', now() );
-
 
168
insert into attrib (name,added_date) values ( 'Model', now() );
-
 
169
insert into attrib (name,added_date) values ( 'Serial Number', now() );
-
 
170
 
-