SET NAMES utf8;

SET FOREIGN_KEY_CHECKS = 0;

ALTER TABLE `t_inventory`
ADD COLUMN IF NOT EXISTS `warehouse_collection_id`  int(11) NULL DEFAULT NULL AFTER `utime`;

REPLACE INTO `t_affair_system_column`(`column_id`, `column_pid`, `group_id`, `column_order`, `column_title`, `column_name`, `column_unit`, `column_type`, `column_control`, `column_rule`, `column_is_virtual`, `column_unit_symbiosis`, `column_detachable`, `status`) VALUES (305, 221, 6, 99992, '供应商型号', 'warehouse_collection_pname', '[{\"key\":\"warehouse_collection_id\"}]', '{\"key\":\"collection_id\",\"value\":\"collection_pname\"}', 28, '{\"regex\":\"\",\"tips\":\"选择供应商型号\"}', 0, '', 0, NULL);

UPDATE `t_affair_system_column` SET `column_pid` = 221, `group_id` = 6, `column_order` = 99991, `column_title` = '产品型号', `column_name` = 'warehouse_product_pname', `column_unit` = '[{\"key\":\"warehouse_product_id\"}]', `column_type` = '{\"key\":\"product_id\",\"value\":\"product_pname\"}', `column_control` = 7, `column_rule` = '{\"regex\":\"\",\"tips\":\"选择产品型号\"}', `column_is_virtual` = 0, `column_unit_symbiosis` = '', `column_detachable` = 0, `status` = NULL WHERE `column_id` = 222;

UPDATE `t_affair_system_column` SET `column_pid` = 221, `group_id` = 6, `column_order` = 99993, `column_title` = '颜色', `column_name` = 'warehouse_product_color', `column_unit` = '[{\"key\":\"all\",\"value\":\"胚布,本白,黑,红,黄\",\"acq\":\"胚布\"}]', `column_type` = '{\"key\":\"string\",\"value\":\"255\"}', `column_control` = 11, `column_rule` = '{\"regex\":\"\",\"tips\":\"产品颜色\"}', `column_is_virtual` = 0, `column_unit_symbiosis` = '', `column_detachable` = 0, `status` = NULL WHERE `column_id` = 223;

UPDATE `t_affair_system_column` SET `column_pid` = 221, `group_id` = 6, `column_order` = 99994, `column_title` = '色号', `column_name` = 'warehouse_product_color_number', `column_unit` = '[{\"key\":\"all\",\"value\":\"\"}]', `column_type` = '{\"key\":\"string\",\"value\":\"255\"}', `column_control` = 11, `column_rule` = '{\"regex\":\"\",\"tips\":\"色号\"}', `column_is_virtual` = 0, `column_unit_symbiosis` = '', `column_detachable` = 0, `status` = NULL WHERE `column_id` = 225;

UPDATE `t_affair_system_column` SET `column_pid` = 221, `group_id` = 6, `column_order` = 99995, `column_title` = '花高', `column_name` = 'warehouse_product_height', `column_unit` = '[{\"key\":\"cm\",\"value\":\"厘米\"}]', `column_type` = '{\"key\":\"double\",\"value\":\"2\"}', `column_control` = 0, `column_rule` = '{\"regex\":\"/^[0-9]+(.[0-9]{0,2})?$/\",\"tips\":\"只能为数字和2位小数点\"}', `column_is_virtual` = 0, `column_unit_symbiosis` = '', `column_detachable` = 0, `status` = NULL WHERE `column_id` = 226;

UPDATE `t_affair_system_column` SET `column_pid` = 221, `group_id` = 6, `column_order` = 99996, `column_title` = '花宽', `column_name` = 'warehouse_product_width', `column_unit` = '[{\"key\":\"cm\",\"value\":\"厘米\"}]', `column_type` = '{\"key\":\"double\",\"value\":\"2\"}', `column_control` = 0, `column_rule` = '{\"regex\":\"/^[0-9]+(.[0-9]{0,2})?$/\",\"tips\":\"只能为数字和2位小数点\"}', `column_is_virtual` = 0, `column_unit_symbiosis` = '', `column_detachable` = 0, `status` = NULL WHERE `column_id` = 227;

UPDATE `t_affair_system_column` SET `column_pid` = 221, `group_id` = 6, `column_order` = 99997, `column_title` = '原料成分', `column_name` = 'warehouse_material_composition', `column_unit` = '[{\"key\":\"all\",\"value\":\"\"}]', `column_type` = '{\"key\":\"string\",\"value\":\"255\"}', `column_control` = 11, `column_rule` = '{\"regex\":\"\",\"tips\":\"原料\"}', `column_is_virtual` = 0, `column_unit_symbiosis` = '', `column_detachable` = 0, `status` = NULL WHERE `column_id` = 228;

UPDATE `t_affair_system_column` SET `column_pid` = 221, `group_id` = 6, `column_order` = 99998, `column_title` = '机台选择', `column_name` = 'warehouse_machine_number', `column_unit` = '[{\"key\":\"warehouse_machine_id\"}]', `column_type` = '{\"key\":\"machine_id\",\"value\":\"machine_number\"}', `column_control` = 9, `column_rule` = '{\"regex\":\"\",\"tips\":\"填写机台编号\"}', `column_is_virtual` = 0, `column_unit_symbiosis` = '', `column_detachable` = 0, `status` = NULL WHERE `column_id` = 229;

UPDATE `t_affair_system_column` SET `column_pid` = 221, `group_id` = 6, `column_order` = 99999, `column_title` = '存放区域', `column_name` = 'warehouse_storage_area', `column_unit` = '[{\"key\":\"all\",\"value\":\"\"}]', `column_type` = '{\"key\":\"string\",\"value\":\"255\"}', `column_control` = 11, `column_rule` = '{\"regex\":\"\",\"tips\":\"存放区域\"}', `column_is_virtual` = 0, `column_unit_symbiosis` = '', `column_detachable` = 0, `status` = NULL WHERE `column_id` = 230;

UPDATE `t_affair_system_column` SET `column_pid` = 221, `group_id` = 6, `column_order` = 999910, `column_title` = '库存数量', `column_name` = 'warehouse_inventory_quantity', `column_unit` = '[]', `column_type` = '{\"key\":\"string\",\"value\":\"255\"}', `column_control` = -1, `column_rule` = '{\"regex\":\"\",\"tips\":\"\"}', `column_is_virtual` = 0, `column_unit_symbiosis` = '', `column_detachable` = 0, `status` = NULL WHERE `column_id` = 235;

UPDATE `t_affair_system_column` SET `column_pid` = 0, `group_id` = 1, `column_order` = 24, `column_title` = '供应商型号', `column_name` = 'collection_pname', `column_unit` = '[{\"key\":\"collection_id\"}]', `column_type` = '{\"key\":\"collection_id\",\"value\":\"collection_pname\"}', `column_control` = 28, `column_rule` = '{\"regex\":\"\",\"tips\":\"选择供应商型号\"}', `column_is_virtual` = 0, `column_unit_symbiosis` = '', `column_detachable` = 0, `status` = NULL WHERE `column_id` = 301;

UPDATE `t_affair_system_column` SET `column_pid` = 221, `group_id` = 6, `column_order` = 999911, `column_title` = '备注', `column_name` = 'warehouse_note', `column_unit` = '[{\"key\":\"all\",\"value\":\"\"}]', `column_type` = '{\"key\":\"string\",\"value\":\"255\"}', `column_control` = -1, `column_rule` = '{\"regex\":\"\",\"tips\":\"设置备注\"}', `column_is_virtual` = 0, `column_unit_symbiosis` = '', `column_detachable` = 0, `status` = NULL WHERE `column_id` = 303;

SET FOREIGN_KEY_CHECKS = 1;