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

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

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

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

INSERT INTO `users` VALUES (1,'deploy_bot@example.org','$2b$12$rQAtoVmb12a.rY9UxbnP7vLmNAOC3d1Co/xMXYPvtCpFqINKLsPEq','admin','ak_1fb41cfc68ce5498','2023-10-03 10:05:00',NULL);
INSERT INTO `users` VALUES (2,'jane.smith@example.org','$2b$12$n1o1vQ438UDMweOe1UywN1jVm2M1W/yCY5T0KlL21PMzQLks6c8eV','user','ak_3511ffa0ba5d01ed','2023-07-16 10:02:00',NULL);
INSERT INTO `users` VALUES (3,'backup_admin@example.org','$2b$12$QAsxOZ6sk8jvkXzRW1KTy/wnkrWNIkZeccwjn1OPfrsQn8FEzyXCM','admin','ak_f16bf3edd79284bc','2023-04-25 10:13:00',NULL);
INSERT INTO `users` VALUES (4,'jane.smith@internal.io','$2b$12$QJICuO9VRr.OVjRu1Snhg7CiS1rQ84Hlk4rpVLWWMtOJl6G8L5r7f','user','ak_15519980f0779446','2023-04-21 10:16:00',NULL);

