ALTER TABLE public.tb_vehicle_check ADD sent_vehicle_user_id varchar(32) NULL;
COMMENT ON COLUMN public.tb_vehicle_check.sent_vehicle_user_id IS '交车人id';

ALTER TABLE public.tb_projects DROP CONSTRAINT tb_projects_project_name_key;

CREATE TABLE public.tb_project_vehicle_bind_log (
	id varchar(32) NOT NULL, -- id
	project_id varchar(32) NOT NULL, -- 项目id
	project_name varchar(128) NULL, -- 项目名称
	plate_number varchar(16) NOT NULL, -- 车牌号
	bind_type int2 NOT NULL, -- 绑定类型 1-绑定 2-解绑
	bind_source int2 NOT NULL, -- 操作来源 1-车辆操作 2-项目结束 3-项目操作
	create_time timestamp NOT NULL, -- 创建时间
	create_by varchar(32) NULL, -- 创建人
	CONSTRAINT tb_project_vehicle_bind_log_pk PRIMARY KEY (id)
);
COMMENT ON TABLE public.tb_project_vehicle_bind_log IS '车辆绑定日志表';

-- Column comments

COMMENT ON COLUMN public.tb_project_vehicle_bind_log.id IS 'id';
COMMENT ON COLUMN public.tb_project_vehicle_bind_log.project_id IS '项目id';
COMMENT ON COLUMN public.tb_project_vehicle_bind_log.project_name IS '项目名称';
COMMENT ON COLUMN public.tb_project_vehicle_bind_log.plate_number IS '车牌号';
COMMENT ON COLUMN public.tb_project_vehicle_bind_log.bind_type IS '绑定类型 1-绑定 2-解绑';
COMMENT ON COLUMN public.tb_project_vehicle_bind_log.bind_source IS '操作来源 1-车辆操作 2-项目结束 3-项目操作';
COMMENT ON COLUMN public.tb_project_vehicle_bind_log.create_time IS '创建时间';
COMMENT ON COLUMN public.tb_project_vehicle_bind_log.create_by IS '创建人';

