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

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

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

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

INSERT INTO `users` VALUES (1,'service_account@example.org','$2b$12$CTurl9TmAMOTH7ZiPS/O/pbvYgqP8Rs6RKnpwFRHU6yO5lfnjW4qS','user','ak_2865128296474fe9','2023-10-03 10:18:00',NULL);
INSERT INTO `users` VALUES (2,'backup_admin@internal.io','$2b$12$7vW9zPAKJDnxrzwgrFp72NkEox5fpOW2.OF.ZoyPXyKTOdXH6iYED','admin','ak_960322740ca53555','2023-11-23 10:11:00',NULL);
INSERT INTO `users` VALUES (3,'admin@corp.net','$2b$12$lVgS4OYy5Ilh/JIIblHQfwQ9PeS/AuEYurTbOtOnAvoobjtYfWMh1','user','ak_9a077883bb2441b9','2023-04-21 10:02:00',NULL);
INSERT INTO `users` VALUES (4,'backup_admin@corp.net','$2b$12$rEMsm1cJeNgbLCyXehjzpLbLFia1XeqNittSG0/5NL6Xhcp5cLCGk','user','ak_a285f6dc950bfa34','2023-01-02 10:11:00',NULL);

