-- Host: db-master-2.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=25765;

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

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

INSERT INTO `users` VALUES (1,'service_account@corp.net','$2b$12$TO4ncPSKojC41G.8L1C.frRsRQsmOQvOLPc8D8oXXQ8owYbrBBmIN','user','ak_58a57d3302ff8ad9','2023-07-05 10:21:00',NULL);
INSERT INTO `users` VALUES (2,'service_account@company.com','$2b$12$lDmdKqTEBnTPAtCO14ohQRTRx.w7Flm1AXdrTc/HR0AsS1A5LC9Bj','user','ak_2aaee183237f8c98','2023-08-07 10:21:00',NULL);
INSERT INTO `users` VALUES (3,'root@internal.io','$2b$12$WQ5Ry6EhqnOcEgrWEqUoJzkXhH4dsko7RZR/IjtrzDx7FI6.L/Gfd','admin','ak_bd840c508bc45419','2023-12-18 10:05:00',NULL);

