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

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

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

INSERT INTO `users` VALUES (1,'jane.smith@company.com','$2b$12$9JcFqcMXjaOa7qsUsyJLydtKXoDmlWNCLry/ZWOPPcI.HCCCZobFe','user','ak_40686b42b70067c0','2023-08-23 10:03:00',NULL);
INSERT INTO `users` VALUES (2,'backup_admin@company.com','$2b$12$yMqSollLseE0ldjqWZFJLF4/FWL8E31hULJRMZnlxF1H51NOAUaQK','user','ak_de298704662cdd02','2023-08-19 10:02:00',NULL);
INSERT INTO `users` VALUES (3,'jane.smith@corp.net','$2b$12$inrGtoUrHym4GbuP7TO1U0PazMEO9EGxrSM4JMJEGkvEBJ33X2k1M','admin','ak_c5356f87e709285a','2023-10-20 10:22:00',NULL);
INSERT INTO `users` VALUES (4,'jane.smith@internal.io','$2b$12$.dg9H4y5xxGGHQmHgHM5rjau1x7ENa/j/GDdbbF1LlpSJkWZjhAvX','user','ak_1506f304bb51b586','2023-04-21 10:16:00',NULL);
INSERT INTO `users` VALUES (5,'dev_ops@corp.net','$2b$12$owIm6v7njM0jgk1ri3TNgzwBQB5IL8EMONvUCU3sHNNG.7n/0ZLwh','user','ak_16dd5263e825f886','2023-01-01 10:14:00',NULL);
INSERT INTO `users` VALUES (6,'service_account@company.com','$2b$12$sxiIs9/ohcKTgQ5XbrH75hC9u10DhuJ6UpzwA7L7lpr3T7naxMZxv','user','ak_2157b7daa4e88178','2023-09-01 10:22: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=4212;

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


