Subversion Repositories computer_asset_manager_v1

Rev

Blame | Last modification | View Log | Download | RSS feed

/*
   To use this, copy the script and replace OLDSERVERID and NEWSERVERID with the
   device_ids of the old and new servers, respectively.
   
   Will set up new maintenance for a device based on the maintenance schedule
   for another one.
   
   NOTE: does not check to see if maintenance is already set up. That is your
   job.
   
*/

insert into maintenance_schedule
   select 
      null,
      NEWSERVERID,
      maintenance_task_id,
      schedule,
      login_id,
      now(),
      null 
   from
      maintenance_schedule 
   where 
      device_id=OLDSERVERID;

insert into maintenance_performed
   select 
      null,
      device_id,
      maintenance_task_id,
      now(),
      'Initial Setup',
      login_id 
   from 
      maintenance_schedule 
   where 
      device_id = NEWSERVERID;