保誠-保戶業務員媒合平台
jack
2022-09-06 c4cac1f47018ddae442654bdfa4b580a37638295
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
ALTER TABLE omo.appointment ADD status varchar NULL;
ALTER TABLE omo.appointment ADD contact_time timestamp NULL;
ALTER TABLE omo.appointment ADD last_modified_date timestamp NULL;
ALTER TABLE omo.customer ADD agree_personal_information_time timestamp NULL;
 
UPDATE omo.appointment SET status = 'AVAILABLE';
UPDATE omo.appointment SET last_modified_date = appointment_date;
 
DROP VIEW omo.appointment_customer_view;
 
CREATE OR REPLACE VIEW omo.appointment_customer_view
AS SELECT a.id AS appointment_id,
          a.phone,
          a.email,
          a.contact_type,
          a.gender,
          a.age,
          a.job,
          a.requirement,
          a.communicate_status,
          a.hope_contact_time,
          a.other_requirement,
          a.agent_no,
          a.appointment_date,
          a.customer_id,
          a.consultant_view_time,
          a.consultant_read_time,
          a.contact_time,
          a.status,
          a.last_modified_date,
          c.name
   FROM omo.appointment a
            LEFT JOIN omo.customer c ON a.customer_id = c.id;
 
ALTER TABLE omo.satisfaction ADD appointment_id bigserial NOT NULL;