File size: 842 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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

-- +migrate Up
-- Add new alert_log_event type
ALTER TYPE enum_alert_log_event RENAME TO enum_alert_log_event_old;
CREATE TYPE enum_alert_log_event AS ENUM (
	'created',
	'reopened',
    'status_changed',
    'assignment_changed',
    'escalated',
    'closed',
    'notification_sent',
    'response_received'
);
ALTER TABLE alert_logs ALTER COLUMN event TYPE enum_alert_log_event USING event::TEXT::enum_alert_log_event;
DROP TYPE enum_alert_log_event_old;

-- +migrate Down

ALTER TYPE enum_alert_log_event RENAME TO enum_alert_log_event_old;
CREATE TYPE enum_alert_log_event AS ENUM (
	'created',
	'reopened',
    'status_changed',
    'assignment_changed',
    'escalated',
    'closed'
);

ALTER TABLE alert_logs ALTER COLUMN event TYPE enum_alert_log_event USING event::TEXT::enum_alert_log_event;
DROP TYPE enum_alert_log_event_old;