-- --------------------------------------------------------
-- Server OS:                    Win64
-- HeidiSQL Version:             12.3.0.6589
-- --------------------------------------------------------



-- Dumping database structure for project_mrderr
CREATE DATABASE IF NOT EXISTS `project_mrderr` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci */;
USE `project_mrderr`;

-- Dumping structure for table project_mrderr.items
CREATE TABLE IF NOT EXISTS `items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `barcode` varchar(255) DEFAULT NULL,
  `item_name` varchar(255) NOT NULL,
  `dateandtime` datetime NOT NULL,
  `delivery_contact_person` varchar(255) NOT NULL,
  `amount` int(11) DEFAULT NULL,
  `price` decimal(10,2) DEFAULT NULL,
  `serial_nr` int(11) DEFAULT NULL,
  `barcode_manufacturer` varchar(255) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  CONSTRAINT `items_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- Dumping data for table project_mrderr.items: ~9 rows (approximately)
INSERT INTO `items` (`id`, `barcode`, `item_name`, `dateandtime`, `delivery_contact_person`, `amount`, `price`, `serial_nr`, `barcode_manufacturer`, `user_id`) VALUES
	(1, 'CE309953957EE', '', '2023-10-12 10:37:00', '', 360, 0.00, 0, '', NULL),
	(2, 'CE309953957EE', '', '2023-10-12 10:37:00', '', 360, 0.00, 0, '', NULL),
	(3, '582941184CFD', 'tests', '2023-10-04 09:00:00', 'Roberts', 360, 2.00, 22252, '25248284trt', NULL),
	(4, '582941184CFD', 'tests', '2023-10-04 09:00:00', 'Roberts', 360, 2.00, 22252, '25248284trt', NULL),
	(5, '  CE440525078EE', 'burka', '2023-10-04 09:17:00', 'Ervins', 0, 2.00, 8248198, '25248284trt', NULL),
	(6, '123', 'Nick Gus', '2023-10-17 09:31:00', 'Mariuss, Kristans', 2, 3.00, 123, '123', NULL),
	(7, '22061985', 'pen', '2023-10-25 08:52:00', 'Kristans', 12, 3.00, 123, '22061985M', 29),
	(8, '2206198511', 'pen_black', '2023-10-24 08:52:00', 'Kristans', 13, 4.00, 1232, '22061985M11', 29),
	(9, '  CE440525078EE', 'burka', '2023-10-25 09:07:00', 'Ervins', 1, 2.00, 8248198, '25248284trt', 29);

-- Dumping structure for table project_mrderr.removed_items
CREATE TABLE IF NOT EXISTS `removed_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `barcode` varchar(255) DEFAULT NULL,
  `item_name` varchar(255) DEFAULT NULL,
  `dateandtime` datetime DEFAULT NULL,
  `delivery_contact_person` varchar(255) DEFAULT NULL,
  `amount` int(11) DEFAULT NULL,
  `price` decimal(10,2) DEFAULT NULL,
  `serial_nr` varchar(255) DEFAULT NULL,
  `barcode_manufacturer` varchar(255) DEFAULT NULL,
  `total_price` decimal(10,2) DEFAULT NULL,
  `original_item_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `original_item_id` (`original_item_id`),
  CONSTRAINT `removed_items_ibfk_1` FOREIGN KEY (`original_item_id`) REFERENCES `items` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- Dumping data for table project_mrderr.removed_items: ~5 rows (approximately)
INSERT INTO `removed_items` (`id`, `barcode`, `item_name`, `dateandtime`, `delivery_contact_person`, `amount`, `price`, `serial_nr`, `barcode_manufacturer`, `total_price`, `original_item_id`) VALUES
	(1, '  CE440525078EE', 'burka', '2023-10-13 13:34:54', 'Ervins', 3, NULL, '8248198', '25248284trt', NULL, NULL),
	(2, '  CE440525078EE', 'burka', '2023-10-13 13:38:51', 'Ervins', 3, 2.00, '8248198', '25248284trt', 6.00, NULL),
	(3, '  CE440525078EE', 'burka', '2023-10-13 13:40:10', 'Ervins', 1, 2.00, '8248198', '25248284trt', 2.00, NULL),
	(4, '  CE440525078EE', 'burka', '2023-10-17 08:07:13', 'Ervins', 3, 2.00, '8248198', '25248284trt', 6.00, NULL),
	(5, '123', 'Nick Gus', '2023-10-17 08:31:58', 'Mariuss', 1, 2.00, '123', '123', 2.00, NULL),
	(6, '  CE440525078EE', 'burka', '2023-10-24 08:30:08', 'Ervins', 1, 2.00, '8248198', '25248284trt', 2.00, 5),
	(7, '  CE440525078EE', 'burka', '2023-10-25 08:05:10', 'Ervins', 9, 2.00, '8248198', '25248284trt', 18.00, 5);

