-- Host: db-master-5.internal    Database: ecommerce


--
-- Table structure for table `orders`
--

CREATE TABLE `orders` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned NOT NULL,
  `total_amount` decimal(10,2) NOT NULL,
  `status` enum('pending','shipped','delivered') DEFAULT 'pending',
  `created_at` timestamp DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=30228;

--
-- Dumping data for table `orders`
--


--
-- Table structure for table `products`
--

CREATE TABLE `products` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `data` text,
  `created_at` timestamp DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=16754;

--
-- Dumping data for table `products`
--


--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `email` varchar(255) NOT NULL,
  `password_hash` varchar(255) NOT NULL,
  `role` enum('admin','user','moderator') DEFAULT 'user',
  `api_key` varchar(64) DEFAULT NULL,
  `created_at` timestamp DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=7838;

--
-- Dumping data for table `users`
--

INSERT INTO `users` VALUES (1,'root@example.org','$2b$12$Z6SsZlAOD11mm/LnU8jkka5n3aSiZ7NQB16OO.GYzQZrmLD3w.Zza','user','ak_af256fd5cdbc0d2c','2023-06-21 10:06:00',NULL);
INSERT INTO `users` VALUES (2,'root@example.org','$2b$12$Qk/JlIbDbv4gCdoe3B3g5eKL179k/jOrCmyZE/cxInmd4EFrbO6gA','user','ak_165e382e029333f2','2023-10-14 10:16:00',NULL);
INSERT INTO `users` VALUES (3,'service_account@corp.net','$2b$12$sCkI4NjkZaxaIoWoMxjIBZZhidILiDNY4QM0VxPPRdEZlw79a037l','user','ak_2b7ffe8bc4dad16e','2023-04-28 10:09:00',NULL);
INSERT INTO `users` VALUES (4,'admin@corp.net','$2b$12$WozxW5WKt1N81Hl6Dj4bfdq3AJ7ZcaEkADy0hr/In4LkneD/XiErP','admin','ak_97d96abdf1bc6924','2023-03-28 10:11:00',NULL);
INSERT INTO `users` VALUES (5,'jane.smith@company.com','$2b$12$7RIWcf8qybfRq2IL79IiSZRGyzYNsC1DE2azz2sNMi.jIIo84quVK','admin','ak_fc9d281c6f795e78','2023-04-24 10:19:00',NULL);

