-- --------------------------------------------------------
-- Server OS:                    Win64
-- HeidiSQL Version:             11.2.0.6213
-- --------------------------------------------------------


-- Dumping structure for table hgagent.delivery_orders
CREATE TABLE IF NOT EXISTS `delivery_orders` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `do_no` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `do_date` date NOT NULL,
  `remark` longtext COLLATE utf8mb4_unicode_ci,
  `is_group` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0:Ungroup,1:Group',
  `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '0:Inactive,1:Active',
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `delivery_order_group_id` bigint(20) unsigned DEFAULT NULL,
  `employee_id` bigint(20) unsigned DEFAULT NULL,
  `pl_id` bigint(20) unsigned DEFAULT NULL,
  `po_id` bigint(20) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `delivery_orders_delivery_order_group_id_foreign` (`delivery_order_group_id`),
  KEY `delivery_orders_employee_id_foreign` (`employee_id`),
  KEY `delivery_orders_pl_id_foreign` (`pl_id`),
  KEY `delivery_orders_po_id_foreign` (`po_id`),
  CONSTRAINT `delivery_orders_delivery_order_group_id_foreign` FOREIGN KEY (`delivery_order_group_id`) REFERENCES `delivery_order_groups` (`id`),
  CONSTRAINT `delivery_orders_employee_id_foreign` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`id`),
  CONSTRAINT `delivery_orders_pl_id_foreign` FOREIGN KEY (`pl_id`) REFERENCES `picking_lists` (`id`),
  CONSTRAINT `delivery_orders_po_id_foreign` FOREIGN KEY (`po_id`) REFERENCES `purchase_orders` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

-- Dumping data for table hgagent.delivery_orders: ~0 rows (approximately)
DELETE FROM `delivery_orders`;

