-- ============================================
-- 실사 낱장 스냅샷 테이블
-- ============================================

CREATE TABLE IF NOT EXISTS `bag_inventory_inspection_sheet_snapshot` (
  `biss_idx` INT UNSIGNED NOT NULL AUTO_INCREMENT,
  `biss_bisi_idx` INT UNSIGNED NOT NULL COMMENT 'bag_inventory_inspection_item FK',
  `biss_lg_idx` INT UNSIGNED NOT NULL,
  `biss_pack_code` VARCHAR(80) NOT NULL,
  `biss_sheet_code` VARCHAR(120) NOT NULL,
  `biss_system_qty` INT UNSIGNED NOT NULL DEFAULT 1,
  `biss_actual_qty` INT UNSIGNED NULL DEFAULT NULL,
  `biss_diff_qty` INT NOT NULL DEFAULT 0,
  `biss_checked_yn` CHAR(1) NOT NULL DEFAULT 'N',
  `biss_regdate` DATETIME NOT NULL,
  PRIMARY KEY (`biss_idx`),
  UNIQUE KEY `uk_biss_item_sheet` (`biss_bisi_idx`,`biss_sheet_code`),
  KEY `idx_biss_item_pack` (`biss_bisi_idx`,`biss_pack_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='실사 낱장 스냅샷';
