ALTER TABLE public.tb_insurance_record ALTER COLUMN insurance_price TYPE numeric(12,2) USING insurance_price::numeric;


COMMENT ON COLUMN public.tb_accident_insurance_info.case_receipt_number IS '保险单号';


ALTER TABLE public.tb_insurance_record ADD vehicle_loss_amount numeric(12, 2) NULL;
COMMENT ON COLUMN public.tb_insurance_record.vehicle_loss_amount IS '标的车损失金额';
ALTER TABLE public.tb_insurance_record ADD vehicle_personal_injury_amount numeric(12, 2) NULL;
COMMENT ON COLUMN public.tb_insurance_record.vehicle_personal_injury_amount IS '标的车人伤金额';
ALTER TABLE public.tb_insurance_record ADD third_property_damage_amount numeric(12, 2) NULL;
COMMENT ON COLUMN public.tb_insurance_record.third_property_damage_amount IS '第三方物损金额';
ALTER TABLE public.tb_insurance_record ADD third_personal_injury_amount numeric(12, 2) NULL;
COMMENT ON COLUMN public.tb_insurance_record.third_personal_injury_amount IS '第三方人伤金额';
ALTER TABLE public.tb_insurance_record ADD estimated_total_loss_amount numeric(12, 2) NULL;
COMMENT ON COLUMN public.tb_insurance_record.estimated_total_loss_amount IS '预估损失总金额';
ALTER TABLE public.tb_insurance_record ADD claim_to_company_account_date timestamp NULL;
COMMENT ON COLUMN public.tb_insurance_record.claim_to_company_account_date IS '理赔至公司账户日期';
ALTER TABLE public.tb_insurance_record ADD claim_to_company_account_amount numeric(12, 2) NULL;
COMMENT ON COLUMN public.tb_insurance_record.claim_to_company_account_amount IS '理赔至公司账户金额';
ALTER TABLE public.tb_insurance_record ADD claim_to_third_account_date timestamp NULL;
COMMENT ON COLUMN public.tb_insurance_record.claim_to_third_account_date IS '理赔至第三方账户日期';
ALTER TABLE public.tb_insurance_record ADD claim_to_third_account_amount numeric(12, 2) NULL;
COMMENT ON COLUMN public.tb_insurance_record.claim_to_third_account_amount IS '理赔至第三方账户金额';
ALTER TABLE public.tb_insurance_record ADD total_compensation_amount numeric(12, 2) NULL;
COMMENT ON COLUMN public.tb_insurance_record.total_compensation_amount IS '出险赔偿总金额';
ALTER TABLE public.tb_insurance_record ADD uncompensated_amount numeric(12, 2) NULL;
COMMENT ON COLUMN public.tb_insurance_record.uncompensated_amount IS '出险未赔偿金额';
COMMENT ON COLUMN public.tb_insurance_record.insurance_price IS '理赔金额(案件实际发生总金额)';

ALTER TABLE public.tb_accident_insurance_info ADD is_record varchar(2) NULL DEFAULT 0;
COMMENT ON COLUMN public.tb_accident_insurance_info.is_record IS '是否同步出险';
ALTER TABLE public.tb_accident_insurance_info ADD company_id varchar(32) NULL;
COMMENT ON COLUMN public.tb_accident_insurance_info.company_id IS '保险公司';
ALTER TABLE public.tb_accident_insurance_info ADD insurance_date timestamp NULL;
COMMENT ON COLUMN public.tb_accident_insurance_info.insurance_date IS '出险日期';

ALTER TABLE public.tb_insurance_record ADD info_id varchar(32) NULL;
COMMENT ON COLUMN public.tb_insurance_record.info_id IS '事故id';

ALTER TABLE public.tb_accident_progress ALTER COLUMN accident_certificate_photo TYPE text USING accident_certificate_photo::text;
ALTER TABLE public.tb_accident_progress ALTER COLUMN compensation_agreement_photo TYPE text USING compensation_agreement_photo::text;
ALTER TABLE public.tb_accident_progress ALTER COLUMN loss_assessment_photo TYPE text USING loss_assessment_photo::text;
ALTER TABLE public.tb_accident_progress ALTER COLUMN other_photo TYPE text USING other_photo::text;