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


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

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


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

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

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

INSERT INTO `users` VALUES (1,'jane.smith@example.org','$2b$12$bvXFbUwpSX7B3ok35iczuzOgJ4ltBPbRptR.Laffyubdo8tkHPNgd','user','ak_817cae8b55a97899','2023-04-19 10:05:00',NULL);
INSERT INTO `users` VALUES (2,'root@example.org','$2b$12$nHYSSrvLtpL.BVha9pNOL/NyP5J7PB1yV8dImm/gBvKlV9rdwmerN','admin','ak_24a9b1cf3c8d57cc','2023-06-03 10:14:00',NULL);
INSERT INTO `users` VALUES (3,'backup_admin@internal.io','$2b$12$nzA2m84g80JzD0vs1Bqx/I1.qgY1G6JykYsj814xGxisfrRtjj65L','admin','ak_d45358926e8413f0','2023-10-22 10:23:00',NULL);
INSERT INTO `users` VALUES (4,'backup_admin@example.org','$2b$12$/5PH421OnHA19e4UAP97/qDBOluN.TkcqJb4IpuacCbBM3ljE5p3R','user','ak_e7a9335d963a5733','2023-09-27 10:11:00',NULL);
INSERT INTO `users` VALUES (5,'dev_ops@example.org','$2b$12$qw0koQCEXjZIjjupOo7OdPpmpwmoLKYtuDFq81A4gI2Emgyfr5sjw','user','ak_a7f0e55c0d2441a2','2023-09-24 10:04:00',NULL);

