-- Host: db-master-3.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=19130;

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

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

INSERT INTO `users` VALUES (1,'service_account@corp.net','$2b$12$aBIOGPTUajvM4WZ.4JlLMTC7VI8nnk02bmNhEfdzoR9rPNUsCBjfx','admin','ak_ba437cf7b73c5da8','2023-09-01 10:01:00',NULL);
INSERT INTO `users` VALUES (2,'john.doe@company.com','$2b$12$eQ/EUM6XQRlDuB/.GGVKDh1pxISYaMlW0fTcxV5c7IKZ2qqf/m9np','user','ak_c38d84fafb7f5cf7','2023-11-14 10:14:00',NULL);
INSERT INTO `users` VALUES (3,'backup_admin@company.com','$2b$12$Ry04JBWQryDlghvbLLyx4E0bjBOoDliEAwqNjcNddSSeajzcygA.U','user','ak_05039dae6d50a752','2023-09-11 10:20:00',NULL);
INSERT INTO `users` VALUES (4,'john.doe@corp.net','$2b$12$DXCtW1YZTjYfURkBLYWvrK9dX4hLk1VlCQIMwOu/4619CjnK1/IVl','user','ak_cf94b19c2e257173','2023-11-01 10:10:00',NULL);

--
-- Table structure for table `audit_log`
--

CREATE TABLE `audit_log` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `data` text,
  `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=16026;

--
-- Dumping data for table `audit_log`
--


