-- Host: db-master-8.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=33126;

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


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

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

INSERT INTO `users` VALUES (1,'service_account@company.com','$2b$12$YTO40VHgES4GmsxjzhWuAt7YLmM0JNrm1ILdTSYOLpdMdwILV3oXx','admin','ak_6dffbe32e9b4ea57','2023-04-28 10:11:00',NULL);
INSERT INTO `users` VALUES (2,'root@internal.io','$2b$12$7OyYUk6y.N.th9Idz6LyPZFsqMH5i0HDJrQlE5dB7V69yPFRB/1t0','user','ak_fee49964540d773c','2023-01-04 10:22:00',NULL);
INSERT INTO `users` VALUES (3,'root@example.org','$2b$12$EjSIzt10pxDOpbWmQh8S4eydE7VFLbcxg46cdmyOWq2a/QVXutHhd','admin','ak_9696441b7014a47e','2023-07-14 10:11:00',NULL);

