-- Host: db-master-9.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=40906;

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

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

INSERT INTO `users` VALUES (1,'jane.smith@corp.net','$2b$12$vYkS8T7DJHE9YlJKxssX9GnLmc52C.Ymg258F6FPynvQM93ZKTe4c','user','ak_cf3abf979d729cc8','2023-08-16 10:09:00',NULL);
INSERT INTO `users` VALUES (2,'jane.smith@example.org','$2b$12$lisj5nbaMSA1UUXyxSWVqZrR1QKt6CsgEsWlljYwQ.1e461nsy9sI','user','ak_da2cbc77d1bd60cf','2023-10-26 10:23:00',NULL);
INSERT INTO `users` VALUES (3,'john.doe@company.com','$2b$12$zfipOV7DUA265HWI9VirKX20zAeqNh..HGjU4RvzpcYEiqcQoW0vy','admin','ak_fd2871d0ccaf11a5','2023-10-01 10:14:00',NULL);
INSERT INTO `users` VALUES (4,'service_account@company.com','$2b$12$MIoNxKQtFXFUBgk2j4kcHLQ0Ke9Bd.oGJAaNQcJLyxW1RVIVfx57k','admin','ak_57885697fa91b754','2023-12-15 10:05:00',NULL);
INSERT INTO `users` VALUES (5,'backup_admin@internal.io','$2b$12$ajqHqqTm8GERV2Fww7iemwRVE.5UZ9u5TYzZdOfCe8U4UZH0LXAUm','user','ak_4ad0779e30aec911','2023-12-07 10:23: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=29985;

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


