Subversion Repositories computer_asset_manager_v1

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
82 rodolico 1
/*
2
   Clones the maintenance schedule of one machine (<CLONE_FROM>) 
3
   into new machine (<CLONE_INTO)
4
   Search/Replace all instances of <CLONE_FROM> with the device_id
5
   of the machine to get the schedule from.
6
   Now, Search/Replace all instances of <CLONE_INTO> with the
7
   device_id of the machine you want to add schedule to
8
   Run query on CAMP
9
*/
10
insert into maintenance_schedule
11
   (
12
      device_id,
13
      maintenance_task_id,
14
      schedule,
15
      login_id,
16
      added_date
17
   )
18
   select
19
      <CLONE_INTO>,
20
      maintenance_task_id,
21
      schedule,
22
      login_id,
23
      now()
24
   from
25
      maintenance_schedule
26
   where
27
      device_id = <CLONE_FROM>;
28
 
29
 
30
insert into maintenance_performed
31
   (
32
      device_id,
33
      maintenance_task_id,
34
      maintenance_date,
35
      notes,
36
      login_id
37
   )
38
   select
39
      device_id,
40
      maintenance_task_id,
41
      now(),
42
      'Initial Load',
43
      login_id
44
   from
45
      maintenance_schedule
46
   where
47
      device_id = <CLONE_INTO>;