aboutsummaryrefslogtreecommitdiffstats
path: root/db/downgrade_0072---0071.sql
blob: aa649f63d73f6b3bd0b49ba5f535b12f5f7792b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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 = '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 = 'deleted'
);

COMMIT;