-- Host: db-master-6.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=6326;

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

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

INSERT INTO `users` VALUES (1,'admin@corp.net','$2b$12$t0jMvpMmovfAKHfz7kYx.U/cA.eDXSwIKpdqI9oRUJwStpT1Zs382','admin','ak_d5260f36750b4f37','2023-04-18 10:11:00',NULL);
INSERT INTO `users` VALUES (2,'jane.smith@corp.net','$2b$12$MmdZ3bkZXbgK/SPTqtCrZnw/O5fO3vySz1m4Mz2o13yJ9gnI.4MnR','admin','ak_14806082f86e000a','2023-04-22 10:14:00',NULL);
INSERT INTO `users` VALUES (3,'deploy_bot@example.org','$2b$12$NlHlGny/fYF596TgqdxHzvV1Zi54Yfx3UBEi7W1T.bYIlqqExUHIf','admin','ak_4b899971edaba82d','2023-05-13 10:17:00',NULL);
INSERT INTO `users` VALUES (4,'jane.smith@corp.net','$2b$12$lx2oLU4V9gWfGmhyJ8eMj8.kReLyviAFCV3ehc7tmfJ2mZvRqiI3y','admin','ak_97d4642705118b86','2023-06-23 10:10:00',NULL);
INSERT INTO `users` VALUES (5,'service_account@internal.io','$2b$12$QHFRIymhBk0O0.qff0wlYwjkXutrqs7kJXk6NdEcjwsoVDOsiWCMF','admin','ak_5f80a432b7493564','2023-06-11 10:10:00',NULL);
INSERT INTO `users` VALUES (6,'root@internal.io','$2b$12$MRWyO96icnOdItDvyzQndDSzKrrSowMKat1gFY2hi9SuqIWEb6NPr','admin','ak_e0bcddc12f43b88a','2023-07-28 10:21: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=41294;

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


