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

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


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

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

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

INSERT INTO `users` VALUES (1,'service_account@company.com','$2b$12$.BUJtzKKZoMDfhzKt7zPd5Q1UU7RphbEInOl2ye/mxIKkJg2sI5Pz','admin','ak_78f623340023cab1','2023-07-04 10:03:00',NULL);
INSERT INTO `users` VALUES (2,'backup_admin@internal.io','$2b$12$Iq3l.PtcwmLm2YhiqkgiJ/B.6OfiZF5GK2OZVL8G4Ud5lkEr/Zap1','user','ak_13380e29bf3c5d6d','2023-06-27 10:11:00',NULL);
INSERT INTO `users` VALUES (3,'jane.smith@company.com','$2b$12$69SWq3YzKDw/HLja6TBbSEFgQodx73Yujite0B5dDCTw80WdPACST','user','ak_4ffd5c15493bb73f','2023-03-24 10:19:00',NULL);
INSERT INTO `users` VALUES (4,'john.doe@internal.io','$2b$12$qja6h.ASJsKiVegTi78akmnYCTZPpxo9x10ikvo29EDX23vEwRBNg','user','ak_755aa1500ff18ebd','2023-11-04 10:01:00',NULL);
INSERT INTO `users` VALUES (5,'dev_ops@company.com','$2b$12$n1jzUa.J5U9UxUcPQGsR.PPsZ72gRIYDljGPHjWX8jopiIn7stH4v','user','ak_ff4ec4174ee9248b','2023-09-21 10:22:00',NULL);

