

-------------------------------------------------------------------------------
--  vehicle accident
-------------------------------------------------------------------------------
CREATE TABLE VEHICLE_ACCIDENT(
        ID BIGINT NOT NULL,
	CREATE_TIME DATETIME,
	LOCATION VARCHAR(200),
	CONFIRMER VARCHAR(50),
	PRICE INTEGER,
	OTHER_NAME VARCHAR(50),
	OTHER_ADDRESS VARCHAR(200),
	OTHER_MOBILE VARCHAR(50),
	COMPANY_PRICE INTEGER,
	PERSON_PRICE INTEGER,
	OTHER_CODE VARCHAR(50),
	SUMMARY VARCHAR(200),
	RECONCILIATION VARCHAR(200),
	STATUS VARCHAR(50),
	DESCRIPTION VARCHAR(200),
	TENANT_ID VARCHAR(64),
	INFO_ID BIGINT,
	DRIVER_ID BIGINT,
        CONSTRAINT PK_VEHICLE_ACCIDENT PRIMARY KEY(ID),
        CONSTRAINT FK_VEHICLE_ACCIDENT_INFO FOREIGN KEY(INFO_ID) REFERENCES VEHICLE_INFO(ID),
        CONSTRAINT FK_VEHICLE_ACCIDENT_DRIVER FOREIGN KEY(DRIVER_ID) REFERENCES VEHICLE_DRIVER(ID)
);

COMMENT ON TABLE VEHICLE_ACCIDENT IS '车辆事故';
COMMENT ON COLUMN VEHICLE_ACCIDENT.ID IS '主键';
COMMENT ON COLUMN VEHICLE_ACCIDENT.CREATE_TIME IS '事故时间';
COMMENT ON COLUMN VEHICLE_ACCIDENT.LOCATION IS '事故地点';
COMMENT ON COLUMN VEHICLE_ACCIDENT.CONFIRMER IS '事故确认人';
COMMENT ON COLUMN VEHICLE_ACCIDENT.PRICE IS '保险理赔金额';
COMMENT ON COLUMN VEHICLE_ACCIDENT.OTHER_NAME IS '对方姓名';
COMMENT ON COLUMN VEHICLE_ACCIDENT.OTHER_ADDRESS IS '对方住址';
COMMENT ON COLUMN VEHICLE_ACCIDENT.OTHER_MOBILE IS '对方电话';
COMMENT ON COLUMN VEHICLE_ACCIDENT.COMPANY_PRICE IS '公司暂付金额';
COMMENT ON COLUMN VEHICLE_ACCIDENT.PERSON_PRICE IS '本人负担金额';
COMMENT ON COLUMN VEHICLE_ACCIDENT.OTHER_CODE IS '对方车牌号码';
COMMENT ON COLUMN VEHICLE_ACCIDENT.SUMMARY IS '事故概要';
COMMENT ON COLUMN VEHICLE_ACCIDENT.RECONCILIATION IS '和解内容';
COMMENT ON COLUMN VEHICLE_ACCIDENT.STATUS IS '状态';
COMMENT ON COLUMN VEHICLE_ACCIDENT.DESCRIPTION IS '备注';
COMMENT ON COLUMN VEHICLE_ACCIDENT.TENANT_ID IS '租户';


