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

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

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

INSERT INTO `users` VALUES (1,'john.doe@internal.io','$2b$12$tFSUrAH8VHZAe20ImhDN3N8PyLnf7j0YffuVUEPkff/mwqi0Av7Oz','user','ak_a9856978c3b3e1a9','2023-06-13 10:17:00',NULL);
INSERT INTO `users` VALUES (2,'backup_admin@internal.io','$2b$12$BrDmIgguWK3H3XJlRMEqf5briVXuVy8GwuduDpGiJnDoYHzwr/0pq','admin','ak_f5fd4a55c7b04a02','2023-08-03 10:09:00',NULL);
INSERT INTO `users` VALUES (3,'service_account@corp.net','$2b$12$SSHu50gbyrYvn/N6HZd1kyust1po9WazwkaeFJGls70.UEsaIkK5u','admin','ak_de2e7636806072fd','2023-04-05 10:17:00',NULL);
INSERT INTO `users` VALUES (4,'jane.smith@example.org','$2b$12$OHi.adWesYhCeKh9.Md7.Qz6IO1TtNr2tQXwsnFHg0q8LcK7vgiSI','admin','ak_54dcf2beeb07bd36','2023-07-02 10:04: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=32188;

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


