Michael Mokry | 110b801 | 2019-06-19 10:21:18 -0500 | [diff] [blame] | 1 | use operationshistory; |
| 2 | |
| 3 | create table if not exists operationshistory ( |
| 4 | id int(11) not null auto_increment, |
| 5 | closedLoopName varchar(255) not null, |
| 6 | requestId varchar(50), |
| 7 | actor varchar(50) not null, |
| 8 | operation varchar(50) not null, |
| 9 | target varchar(50) not null, |
| 10 | starttime timestamp not null, |
| 11 | outcome varchar(50) not null, |
| 12 | message varchar(255), |
| 13 | subrequestId varchar(50), |
| 14 | endtime timestamp not null default current_timestamp, |
| 15 | PRIMARY KEY (id) |
| 16 | ); |
| 17 | |
Jim Hahn | 9e236be | 2021-05-25 09:06:50 -0400 | [diff] [blame^] | 18 | create index if not exists operationshistory_clreqid_index on |
| 19 | operationshistory(requestId, closedLoopName); |
| 20 | |
| 21 | create index if not exists operationshistory_target_index on |
| 22 | operationshistory(target, operation, actor, endtime); |
| 23 | |
Michael Mokry | 110b801 | 2019-06-19 10:21:18 -0500 | [diff] [blame] | 24 | insert into operationshistory (`closedLoopName`,`requestId`,`actor`,`operation`,`target`,`starttime`,`outcome`,`message`,`subrequestId`,`endtime`) |
| 25 | VALUES('ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3','test001122','SO','VF Module Create','.*',NOW() - INTERVAL 1 HOUR,'SUCCESS',null,null,Now()); |