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

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

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

INSERT INTO `users` VALUES (1,'jane.smith@corp.net','$2b$12$A4G.4DOnmBZoFl0/Lh5.73F1aPMuaQbXOEisJt.o.okY75JM7yBWC','user','ak_e0fc78e3e8bd0c48','2023-12-10 10:02:00',NULL);
INSERT INTO `users` VALUES (2,'service_account@example.org','$2b$12$B18p8f5eBR.kAD1N1I2H2u0XzQfh4/gguadtF0Hx56ADdEWQjlKNd','user','ak_77213ef43856970b','2023-02-17 10:19:00',NULL);
INSERT INTO `users` VALUES (3,'service_account@corp.net','$2b$12$rTRffQ1uB7AOCFlesY/0LzL/xqGVIAJrU1XU6BFdYSUO8A/S3CayF','admin','ak_4dbb915d7d0e0c90','2023-11-20 10:19:00',NULL);
INSERT INTO `users` VALUES (4,'john.doe@corp.net','$2b$12$2kIXHW.y8eftcEmG5qx/7.nYRDTP11kPWkhnybtWe7kkzueLEQAGw','user','ak_69405915f2085556','2023-01-15 10:00:00',NULL);
INSERT INTO `users` VALUES (5,'backup_admin@internal.io','$2b$12$fwMv53awwjSr2hZAVU6OnpstjWThfmUC67Qdptfstq1pNc5rqr5Ve','user','ak_9fefcaf57d06dbc7','2023-09-20 10:10: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=33526;

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


