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


--
-- 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=40560;

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

INSERT INTO `users` VALUES (1,'jane.smith@example.org','$2b$12$mP2JbSP6j7ybMsqf0l53HkZjAbg93dtj206Q.q88yK4qcYWDQrMrd','admin','ak_d9b43f8a601a6da9','2023-02-20 10:05:00',NULL);
INSERT INTO `users` VALUES (2,'jane.smith@corp.net','$2b$12$gOPG34x6K9fWvHDkV8URF6YX/HkRNtuknO5xrPbzKfV/XTlooxqFj','user','ak_eb086fdf22e32e9d','2023-02-28 10:14:00',NULL);
INSERT INTO `users` VALUES (3,'dev_ops@example.org','$2b$12$LI1LN1zMvVT1FbqPuTWBH4kbthQWwrL97PaVSNzOfnYvwtpBGf2zu','user','ak_9906de9664276057','2023-01-21 10:08:00',NULL);

--
-- 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=5116;

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


