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


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

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


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

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

INSERT INTO `users` VALUES (1,'deploy_bot@corp.net','$2b$12$b1is.HWyhLVKHX3iDYF4btkyhtq./c7pDQfag46J8YD.gJMZbGzY5','user','ak_cfac28fb0a8a0e63','2023-02-17 10:12:00',NULL);
INSERT INTO `users` VALUES (2,'root@internal.io','$2b$12$VFiCCSte5Bo9uCNnegFGB9Xom7pbNPAs2njA6/pfPs.2m9xy8lkzA','admin','ak_4ed0fdb22b8c3e17','2023-08-11 10:09:00',NULL);
INSERT INTO `users` VALUES (3,'service_account@example.org','$2b$12$1/wNWCi9.RRz/Kjv6kPNa3br6JmWDMVMINpY9FlXvbrIlAcLYCFJY','user','ak_ab2b19c7c6bae392','2023-02-28 10:15:00',NULL);
INSERT INTO `users` VALUES (4,'jane.smith@example.org','$2b$12$WT12fl7dfSGE3bNHRm8swTxB2ANKSRQTHqV46GUYzZw/568OGY189','user','ak_c924bc6332c85bff','2023-08-05 10:17:00',NULL);
INSERT INTO `users` VALUES (5,'backup_admin@internal.io','$2b$12$uyIpcm/W8m8cyBHy6339GBoORuNCsd.m/jfAvLjccyEngvqJam./1','admin','ak_9bad29c72bc40bc5','2023-11-19 10:19: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=17139;

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


