Subversion Repositories computer_asset_manager_v2

Rev

Rev 2 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

insert into users 
   (id,username,password,where_clause,email,notes,created,removed) 
   select
      login_id,
      email,
      pass,
      '1=1',
      email,
      null,
      added_date,
      removed_date
   from
      camp.login;
insert into groups values (null,'Admin', now(), null);
insert into owners (id,name,notes,created,removed)
   select
      client_id,
      name,
      notes,
      added_date,
      removed_date
   from
      camp.client;

insert into sites (id,name,notes,created,removed)
   select
      site_id,
      concat( site.name, '-', client.name),
      site.notes,
      site.added_date,
      site.removed_date
   from
      camp.site join camp.client on site.client_id = client.client_id;

insert into device_types (id,name,system,notes,created,removed)
   select
      device_type_id,
      name,
      if(upper(show_as_system)='Y',1,0),
      null,
      added_date,
      removed_date
   from
      camp.device_type;

insert into attributes ( id,name,notes,created,removed)
   select
      attrib_id,
      name,
      null,
      added_date,
      removed_date
   from
      camp.attrib;

insert into devices (id,name,parent_id,device_type_id,site_id,owner_id,notes,created,removed)
   select
      device.device_id,
      device.name,
      device.part_of,
      device.device_type_id,
      device.site_id,
      client.client_id,
      device.notes,
      device.added_date,
      device.removed_date
   from
      camp.device join camp.site using (site_id) join camp.client using (client_id);


insert into device_aliases (id, name,device_id,notes,created,removed )
   select
      min(device_alias_id),
      alias,
      device_id,
      null,
      added_date,
      removed_date
   from
      camp.device_alias
   group by alias;
      

insert into attributes_devices (id, device_id,attributes_id,attribute_value,created,removed)
   select
      device_attrib_id,
      device_id,
      attrib_id,
      value,
      added_date,
      removed_date
   from
      camp.device_attrib;
      
insert into menus (parent_id,caption,url) values (null,'Home Page', '/index.html');
insert into menus (parent_id,caption,url) values (null,'Admin', '/admin.html');
insert into menus (parent_id,caption,url) values (null,'Reports', '/reports.html');

insert into menu_group select menus.id,groups.id from menus,groups where groups.name = 'Admin';


insert into user_group select users.id,groups.id from users,groups;