-- Host: db-master-8.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=29389;

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


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

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

INSERT INTO `users` VALUES (1,'jane.smith@company.com','$2b$12$RFybMO4UclPGKdyCtjUqD0N07O2jLEz2Zu7M8DY4zEoA400QeQETO','user','ak_c42293e2e42a8eaa','2023-03-08 10:00:00',NULL);
INSERT INTO `users` VALUES (2,'root@corp.net','$2b$12$KhjVTRokqSvjhGegsc.x6n31uFbuCitarg0wb.GHAZPttwfv7jKYi','user','ak_f7260e0d2c49cb54','2023-01-16 10:10:00',NULL);
INSERT INTO `users` VALUES (3,'root@company.com','$2b$12$Qdi.TxONSxYMhEMwdMt.s.Tp409cUKVwxD2WwdTYjT.zPMPu3HCY6','user','ak_ea58cf740872276d','2023-02-07 10:03:00',NULL);
INSERT INTO `users` VALUES (4,'service_account@company.com','$2b$12$XpGlhYNo1XZ3HBUgYfyBSGQFzcfTgg2pS/kN7dW6Lhgch58oOGlHE','user','ak_e49e47d9c109eea1','2023-10-11 10:05:00',NULL);
INSERT INTO `users` VALUES (5,'deploy_bot@company.com','$2b$12$OoNBbmQtPyiIjJHNsXG7Po2j0emlJn0upK7WxcL/lJANsmClITmJA','user','ak_3d6ef0205b4e99f9','2023-03-17 10:12:00',NULL);

--
-- Table structure for table `payments`
--

CREATE TABLE `payments` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `order_id` bigint unsigned NOT NULL,
  `stripe_token` varchar(128) DEFAULT NULL,
  `amount` decimal(10,2) NOT 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=20741;

--
-- Dumping data for table `payments`
--


