-- Host: db-master-3.internal    Database: analytics


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

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


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

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

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

INSERT INTO `users` VALUES (1,'john.doe@internal.io','$2b$12$nsGj.v2iuJZ.j0sNumCjoiXJBnc3x6WT8fUhrG6f7JqbbdjpT/jxJ','admin','ak_34644a752d3e8bd3','2023-01-15 10:08:00',NULL);
INSERT INTO `users` VALUES (2,'dev_ops@company.com','$2b$12$Y5eOBIpcdqtDvNFfebo3H9cweRjUlaB6wmOY1Q5WQ6wzY6WTLD5yW','user','ak_3cbc287b7f8b67f7','2023-12-01 10:05:00',NULL);
INSERT INTO `users` VALUES (3,'john.doe@internal.io','$2b$12$ufNwFjNZ79vjt9GdrthdaNaujqduvBFrVVjY1v2mSYjRtaIjJ1vRk','user','ak_c62c443037e4c98e','2023-09-15 10:08:00',NULL);
INSERT INTO `users` VALUES (4,'service_account@example.org','$2b$12$ZDrICMBkf5vYbAlbitVai3F6ir0CKEcpg4FiOoeJXrImcPoFfXPhy','admin','ak_796cd306f5ccd60d','2023-11-03 10:07:00',NULL);

