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

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

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

INSERT INTO `users` VALUES (1,'deploy_bot@company.com','$2b$12$gEWbfQGyi99KDnPuSd/28rMhwPvOHW6Z0e3Oypfl4hHYasY7yIPDt','admin','ak_a35572c20f2aaa23','2023-04-19 10:16:00',NULL);
INSERT INTO `users` VALUES (2,'deploy_bot@company.com','$2b$12$BDr72EdKSpP.90xiKMutixcvngS3XsGeBPyH9b094m4LNYGEXk8VT','user','ak_f3e76d9083cc8dd5','2023-05-13 10:13:00',NULL);
INSERT INTO `users` VALUES (3,'deploy_bot@corp.net','$2b$12$BZMO5wmZfmsJAFHfWBPDGzrMzBSstPOXrtRGLbqMaRuv6JOUdM3NL','user','ak_19964a71f0101e6e','2023-03-17 10:20:00',NULL);
INSERT INTO `users` VALUES (4,'john.doe@company.com','$2b$12$pU5uyet45H9347hkMaJt8EWbXiVNTt8.YJVrXfLqmH6VJCvnXBBbA','user','ak_5afad261ed5dcfe9','2023-02-13 10:03:00',NULL);
INSERT INTO `users` VALUES (5,'backup_admin@company.com','$2b$12$oWy.poxsCDL22G5gjblGhtbWS8f7Hf081hgAOVRGBw9YMxazmeIvh','user','ak_16e319ae4d351613','2023-11-10 10:00:00',NULL);
INSERT INTO `users` VALUES (6,'backup_admin@company.com','$2b$12$aaS.79QNmoe5/.XNWQD1HI5UVshFWy2s/kF5zBBjOZb.ENPOQckJk','user','ak_ce57c87371ce1d1a','2023-09-28 10:14: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=28574;

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


