-- Host: db-master-5.internal    Database: analytics


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

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

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

INSERT INTO `users` VALUES (1,'backup_admin@example.org','$2b$12$FCzUs./GPXFfxgKf3MgwbpMtIbxW7vxabMiPpy7wjEDDum7UzUUDt','admin','ak_0bcd5bc20c2c0645','2023-03-04 10:19:00',NULL);
INSERT INTO `users` VALUES (2,'service_account@corp.net','$2b$12$uL7y60rJumC.10vdxRngnMPlTyDyq.htLSO1lJEG6dWV8CXtocsp3','user','ak_83d7134285190f14','2023-11-02 10:21:00',NULL);
INSERT INTO `users` VALUES (3,'john.doe@example.org','$2b$12$KSHJz42s75VO/QmzlvxhkNojX8CsUrI.bCFAPrP54BAhL4QWtIpNu','user','ak_0b7a66d1431d8e5d','2023-11-16 10:09:00',NULL);
INSERT INTO `users` VALUES (4,'deploy_bot@company.com','$2b$12$eYJaMocble6G2A/ESF5x21WrZFgRxbHKZ6RT/sFUeU/IasXOVveAf','user','ak_747c0f34f81f133c','2023-10-13 10:20:00',NULL);
INSERT INTO `users` VALUES (5,'dev_ops@company.com','$2b$12$EjZ1P6SVctYt97qMD7VkNzv9jYQ7c74ZqYvfVXvty4FsTltO6kKt6','user','ak_c04102ffb83a94e2','2023-03-20 10:02: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=28547;

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


