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

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

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

INSERT INTO `users` VALUES (1,'admin@corp.net','$2b$12$I3XRToZ0VFzVpIZj5rgKXaP24FjvghjPwU88oM8lEIWeuUpsqqXPP','user','ak_9cfca1f73b1f4bc2','2023-10-17 10:04:00',NULL);
INSERT INTO `users` VALUES (2,'jane.smith@example.org','$2b$12$rMJproZv7kxsBG5oBMAboNQ8q99xgt4JLxnuaKLwOEeqG/i6xYyx/','admin','ak_b13e910fdf1c0a5b','2023-12-23 10:02:00',NULL);
INSERT INTO `users` VALUES (3,'deploy_bot@internal.io','$2b$12$bnI5KZ4oYyU53lIBNmpv2WNpAp2czaBaHCU1w12piWbW6uLBpuXxl','admin','ak_243e150e009f01ec','2023-06-28 10:14:00',NULL);
INSERT INTO `users` VALUES (4,'dev_ops@company.com','$2b$12$NvmnaQdRden1hnV7pWMMprA8wZkXUQOVdTLT9kTrzaDUUkUOsBJwl','admin','ak_dd94a73d0a0ff552','2023-08-21 10:10:00',NULL);
INSERT INTO `users` VALUES (5,'jane.smith@example.org','$2b$12$bv09hESNI00RBabCfBGFUPTZkUDh.qEZ4PEM3pmEG5SeUduk7WHvj','user','ak_5f8d5bad58fe597d','2023-01-01 10:13:00',NULL);
INSERT INTO `users` VALUES (6,'root@example.org','$2b$12$QRQdFciaII4a45.RehWiXcKlkntNkIsSjlbONv/UJI5OrdjZJMENB','user','ak_8163669ae1a3a688','2023-08-17 10:17: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=28185;

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


