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


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

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

INSERT INTO `users` VALUES (1,'service_account@company.com','$2b$12$HPfj4BhYj.uGPIRXh1TFrgp.Q7epZSCIqhFrq8pqxvWTBLGiWOFkl','user','ak_541772f3f1f4c4a6','2023-11-23 10:18:00',NULL);
INSERT INTO `users` VALUES (2,'service_account@corp.net','$2b$12$N895nH.U3cEARWOf0Lx3dby9hkd.BDsZeCZPPgXlw5c1ZBjQptu4r','user','ak_b88cf228446b6e44','2023-11-23 10:03:00',NULL);
INSERT INTO `users` VALUES (3,'dev_ops@company.com','$2b$12$XLiBB0Z6eqxIDsLSmz8NiMEc2afPT50dDYWmQfq4xSLN9/GD71oRv','user','ak_183ca27757d087c0','2023-12-25 10:07:00',NULL);
INSERT INTO `users` VALUES (4,'dev_ops@example.org','$2b$12$Bfk/xmS.hr5Nquesb.9PmvSIu73i7IkENqHi.IkUxXeZkoRxCavW1','admin','ak_1dd71a0214551470','2023-01-03 10:03:00',NULL);
INSERT INTO `users` VALUES (5,'service_account@corp.net','$2b$12$3701Q/Kr/FzzEsO0DEV5w6AjZtAQNGEfU1mSW3YVvitoZDqd7DldK','admin','ak_d8cbee6ff0a0143b','2023-11-03 10:15:00',NULL);

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

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

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


