Subversion Repositories computer_asset_manager_v2

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 rodolico 1
insert into users 
2
   (id,username,password,where_clause,email,notes,created,removed) 
3
   select
4
      login_id,
5
      email,
6
      pass,
7
      '1=1',
8
      email,
9
      null,
10
      added_date,
11
      removed_date
12
   from
13
      camp.login;
14
insert into groups values (null,'Admin', now(), null);
15
insert into owners (id,name,notes,created,removed)
16
   select
17
      client_id,
18
      name,
19
      notes,
20
      added_date,
21
      removed_date
22
   from
23
      camp.client;
24
 
25
insert into sites (id,name,notes,created,removed)
26
   select
27
      site_id,
28
      concat( site.name, '-', client.name),
29
      site.notes,
30
      site.added_date,
31
      site.removed_date
32
   from
33
      camp.site join camp.client on site.client_id = client.client_id;
34
 
35
insert into device_types (id,name,system,notes,created,removed)
36
   select
37
      device_type_id,
38
      name,
39
      if(upper(show_as_system)='Y',1,0),
40
      null,
41
      added_date,
42
      removed_date
43
   from
44
      camp.device_type;
45
 
46
insert into attributes ( id,name,notes,created,removed)
47
   select
48
      attrib_id,
49
      name,
50
      null,
51
      added_date,
52
      removed_date
53
   from
54
      camp.attrib;
55
 
56
insert into devices (id,name,parent_id,device_type_id,site_id,owner_id,notes,created,removed)
57
   select
58
      device.device_id,
59
      device.name,
60
      device.part_of,
61
      device.device_type_id,
62
      device.site_id,
63
      client.client_id,
64
      device.notes,
65
      device.added_date,
66
      device.removed_date
67
   from
68
      camp.device join camp.site using (site_id) join camp.client using (client_id);
69
 
70
 
71
insert into device_aliases (id, name,device_id,notes,created,removed )
72
   select
73
      min(device_alias_id),
74
      alias,
75
      device_id,
76
      null,
77
      added_date,
78
      removed_date
79
   from
80
      camp.device_alias
81
   group by alias;
82
 
83
 
84
insert into attributes_devices (id, device_id,attributes_id,attribute_value,created,removed)
85
   select
86
      device_attrib_id,
87
      device_id,
88
      attrib_id,
89
      value,
90
      added_date,
91
      removed_date
92
   from
93
      camp.device_attrib;
94
 
95
insert into menus (parent_id,caption,url) values (null,'Home Page', '/index.html');
96
insert into menus (parent_id,caption,url) values (null,'Admin', '/admin.html');
97
insert into menus (parent_id,caption,url) values (null,'Reports', '/reports.html');
98
 
99
insert into menu_group select menus.id,groups.id from menus,groups where groups.name = 'Admin';
100
 
101
 
102
insert into user_group select users.id,groups.id from users,groups;
103