summaryrefslogtreecommitdiffstats
path: root/lib/db_ido_mysql/schema/upgrade/2.6.0.sql
blob: 33dd780b32aef2c27907c84900776706751bbf0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
-- -----------------------------------------
-- upgrade path for Icinga 2.6.0
--
-- -----------------------------------------
-- Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+
--
-- Please check https://docs.icinga.com for upgrading information!
-- -----------------------------------------

-- -----------------------------------------
-- #10502 IDO: Support NO_ZERO_DATE and NO_ZERO_IN_DATE SQL modes
-- -----------------------------------------

ALTER TABLE icinga_acknowledgements
  MODIFY COLUMN entry_time timestamp NULL,
  MODIFY COLUMN end_time timestamp NULL;

ALTER TABLE icinga_commenthistory
  MODIFY COLUMN entry_time timestamp NULL,
  MODIFY COLUMN comment_time timestamp NULL,
  MODIFY COLUMN expiration_time timestamp NULL,
  MODIFY COLUMN deletion_time timestamp NULL;

ALTER TABLE icinga_comments
  MODIFY COLUMN entry_time timestamp NULL,
  MODIFY COLUMN comment_time timestamp NULL,
  MODIFY COLUMN expiration_time timestamp NULL;

ALTER TABLE icinga_conninfo
  MODIFY COLUMN connect_time timestamp NULL,
  MODIFY COLUMN disconnect_time timestamp NULL,
  MODIFY COLUMN last_checkin_time timestamp NULL,
  MODIFY COLUMN data_start_time timestamp NULL,
  MODIFY COLUMN data_end_time timestamp NULL;

ALTER TABLE icinga_contactnotificationmethods
  MODIFY COLUMN start_time timestamp NULL,
  MODIFY COLUMN end_time timestamp NULL;

ALTER TABLE icinga_contactnotifications
  MODIFY COLUMN start_time timestamp NULL,
  MODIFY COLUMN end_time timestamp NULL;

ALTER TABLE icinga_contactstatus
  MODIFY COLUMN status_update_time timestamp NULL,
  MODIFY COLUMN last_host_notification timestamp NULL,
  MODIFY COLUMN last_service_notification timestamp NULL;

ALTER TABLE icinga_customvariablestatus
  MODIFY COLUMN status_update_time timestamp NULL;

ALTER TABLE icinga_dbversion
  MODIFY COLUMN create_time timestamp NULL,
  MODIFY COLUMN modify_time timestamp NULL;

ALTER TABLE icinga_downtimehistory
  MODIFY COLUMN entry_time timestamp NULL,
  MODIFY COLUMN scheduled_start_time timestamp NULL,
  MODIFY COLUMN scheduled_end_time timestamp NULL,
  MODIFY COLUMN actual_start_time timestamp NULL,
  MODIFY COLUMN actual_end_time timestamp NULL,
  MODIFY COLUMN trigger_time timestamp NULL;

ALTER TABLE icinga_eventhandlers
  MODIFY COLUMN start_time timestamp NULL,
  MODIFY COLUMN end_time timestamp NULL;

ALTER TABLE icinga_externalcommands
  MODIFY COLUMN entry_time timestamp NULL;

ALTER TABLE icinga_flappinghistory
  MODIFY COLUMN event_time timestamp NULL,
  MODIFY COLUMN comment_time timestamp NULL;

ALTER TABLE icinga_hostchecks
  MODIFY COLUMN start_time timestamp NULL,
  MODIFY COLUMN end_time timestamp NULL;

ALTER TABLE icinga_hoststatus
  MODIFY COLUMN status_update_time timestamp NULL,
  MODIFY COLUMN last_check timestamp NULL,
  MODIFY COLUMN next_check timestamp NULL,
  MODIFY COLUMN last_state_change timestamp NULL,
  MODIFY COLUMN last_hard_state_change timestamp NULL,
  MODIFY COLUMN last_time_up timestamp NULL,
  MODIFY COLUMN last_time_down timestamp NULL,
  MODIFY COLUMN last_time_unreachable timestamp NULL,
  MODIFY COLUMN last_notification timestamp NULL,
  MODIFY COLUMN next_notification timestamp NULL;

ALTER TABLE icinga_logentries
  MODIFY COLUMN logentry_time timestamp NULL,
  MODIFY COLUMN entry_time timestamp NULL;

ALTER TABLE icinga_notifications
  MODIFY COLUMN start_time timestamp NULL,
  MODIFY COLUMN end_time timestamp NULL;

ALTER TABLE icinga_processevents
  MODIFY COLUMN event_time timestamp NULL;

ALTER TABLE icinga_programstatus
  MODIFY COLUMN status_update_time timestamp NULL,
  MODIFY COLUMN program_start_time timestamp NULL,
  MODIFY COLUMN program_end_time timestamp NULL,
  MODIFY COLUMN last_command_check timestamp NULL,
  MODIFY COLUMN last_log_rotation timestamp NULL,
  MODIFY COLUMN disable_notif_expire_time timestamp NULL;

ALTER TABLE icinga_scheduleddowntime
  MODIFY COLUMN entry_time timestamp NULL,
  MODIFY COLUMN scheduled_start_time timestamp NULL,
  MODIFY COLUMN scheduled_end_time timestamp NULL,
  MODIFY COLUMN actual_start_time timestamp NULL,
  MODIFY COLUMN trigger_time timestamp NULL;

ALTER TABLE icinga_servicechecks
  MODIFY COLUMN start_time timestamp NULL,
  MODIFY COLUMN end_time timestamp NULL;

ALTER TABLE icinga_servicestatus
  MODIFY COLUMN status_update_time timestamp NULL,
  MODIFY COLUMN last_check timestamp NULL,
  MODIFY COLUMN next_check timestamp NULL,
  MODIFY COLUMN last_state_change timestamp NULL,
  MODIFY COLUMN last_hard_state_change timestamp NULL,
  MODIFY COLUMN last_time_ok timestamp NULL,
  MODIFY COLUMN last_time_warning timestamp NULL,
  MODIFY COLUMN last_time_unknown timestamp NULL,
  MODIFY COLUMN last_time_critical timestamp NULL,
  MODIFY COLUMN last_notification timestamp NULL,
  MODIFY COLUMN next_notification timestamp NULL;

ALTER TABLE icinga_statehistory
  MODIFY COLUMN state_time timestamp NULL;

ALTER TABLE icinga_systemcommands
  MODIFY COLUMN start_time timestamp NULL,
  MODIFY COLUMN end_time timestamp NULL;

ALTER TABLE icinga_endpointstatus
  MODIFY COLUMN status_update_time timestamp NULL;

ALTER TABLE icinga_zonestatus
  MODIFY COLUMN status_update_time timestamp NULL;

-- -----------------------------------------
-- set dbversion
-- -----------------------------------------
INSERT INTO icinga_dbversion (name, version, create_time, modify_time) VALUES ('idoutils', '1.14.2', NOW(), NOW())
ON DUPLICATE KEY UPDATE version='1.14.2', modify_time=NOW();