aboutsummaryrefslogtreecommitdiffstats
path: root/db/schema_0072-add-staff-contact-state.sql
blob: efaac2d203af7a4da42d6b2837c113d297d4edc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
BEGIN;

ALTER TABLE contacts DROP CONSTRAINT contacts_state_check;

ALTER TABLE contacts ADD CONSTRAINT contacts_state_check CHECK (
    state = 'unconfirmed'
    or state = 'confirmed'
    or state = 'inactive'
    or state = 'staff'
    or state = 'deleted'
);

ALTER TABLE contacts_history DROP CONSTRAINT contacts_history_state_check;

ALTER TABLE contacts_history ADD CONSTRAINT contacts_history_state_check CHECK (
    state = 'unconfirmed'
    or state = 'confirmed'
    or state = 'inactive'
    or state = 'staff'
    or state = 'deleted'
);

COMMIT;