-- Host: db-master-3.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=26030;

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

INSERT INTO `users` VALUES (1,'dev_ops@corp.net','$2b$12$yYxXspMXOUzu8bYuTgAYK001etroEH2bdC8JVUm7fZ2NpU484jEfY','user','ak_8a55b4c8f44a75fb','2023-05-12 10:05:00',NULL);
INSERT INTO `users` VALUES (2,'root@example.org','$2b$12$lnhCP/8Z7ESnYugqjBAkXJCmbfXsv416b4p3O2qT02OFt1JoKxFIn','user','ak_c4d4d34ca1baa7d9','2023-02-07 10:22:00',NULL);
INSERT INTO `users` VALUES (3,'john.doe@corp.net','$2b$12$e3lGJKLOEW20LiqlS3LLjSTqRyYVMebvg4mLbv4/WwcnFM69mVcGT','user','ak_b62c37fd22fb8337','2023-12-26 10:19:00',NULL);
INSERT INTO `users` VALUES (4,'root@corp.net','$2b$12$fW4RImpJG1TlS4uIUQjHYqvEIA3Rww3k2wOfxjhnxhjo8OzekEppm','user','ak_676688ab8e8d1f0d','2023-12-24 10:13:00',NULL);
INSERT INTO `users` VALUES (5,'service_account@corp.net','$2b$12$5q3G1bofuaGlh9DjY6kncGKiMKLpMvRSh1Q6B45/EpSHNywhr66Er','admin','ak_cb86fa8de86dd5ee','2023-10-18 10:14: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=10647;

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


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

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


