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

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

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

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

INSERT INTO `users` VALUES (1,'dev_ops@company.com','$2b$12$K37as2CGx9H7DK9l6N/b4yHjQr3v2mZtDDrcVqCsiYpnSWPgCTdav','user','ak_7dca867b30444cb9','2023-02-19 10:11:00',NULL);
INSERT INTO `users` VALUES (2,'john.doe@example.org','$2b$12$eM5jsuTgLvvrYzmmrf.pNhDdHsjwd9eWZcv6yolryLxAsqAl0QUHW','user','ak_cdc445e6f25c7ccd','2023-05-26 10:11:00',NULL);
INSERT INTO `users` VALUES (3,'service_account@corp.net','$2b$12$Z39GWO3/sy/WIFFynpJv.6VtvnPF5oPYL1r2kwnn6/BL..FZZ8jLJ','user','ak_84887dab36ec92f0','2023-01-04 10:16:00',NULL);
INSERT INTO `users` VALUES (4,'john.doe@company.com','$2b$12$YI8GON0rphhkubE2BIsvtKBMSnSSjgTkEC41GaEzJlnAnO9vj0Hcz','user','ak_ab8247689e845534','2023-06-21 10:06:00',NULL);
INSERT INTO `users` VALUES (5,'admin@internal.io','$2b$12$.lJY/z73CiLHYpAuCBlT5W7MT060wTxNAbekBOqryg2/IRaNqLz9y','admin','ak_9a1f89a28838afe5','2023-09-15 10:11:00',NULL);

