
-- ----------------------------
-- 成品仓库变动记录表
-- ----------------------------
CREATE TABLE `hazmat_manage`.`hz_product_warehouse_record`  (
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
`basic_id` bigint NOT NULL COMMENT '危化品/成品基础id',
`warehouse_id` bigint NOT NULL COMMENT '仓库id',
`remaining` int NOT NULL DEFAULT 0 COMMENT '变动后剩余数量',
`num` int NOT NULL DEFAULT 0 COMMENT '数量',
`state` tinyint NOT NULL DEFAULT 0 COMMENT '操作类型(0批量导入，3标签作废，5销售)',
`company_id` bigint NOT NULL COMMENT '企业id',
`create_id` bigint NOT NULL COMMENT '操作人id',
`create_by` varchar(20) NULL,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`update_by` varchar(20) NULL,
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`remark` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
`version` int NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
INDEX `index_basic_warehouse`(`basic_id`, `warehouse_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '成品仓库变动记录表' ROW_FORMAT = Dynamic;