-- Host: db-master-0.internal    Database: ecommerce


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

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

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

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

INSERT INTO `users` VALUES (1,'service_account@corp.net','$2b$12$aLsvXL.Ankvk5/voG4TI9WzyplOOhhz51Qksf2/7KwE1LrytDRCb8','admin','ak_640d3c5bfc882a8b','2023-06-28 10:00:00',NULL);
INSERT INTO `users` VALUES (2,'john.doe@internal.io','$2b$12$kdBxvkuX7FZmKchw2NyicdazUXCZcS31bjhPlbMdNvJPD3VqF6q/W','user','ak_56614f4fc3d23bb4','2023-07-01 10:12:00',NULL);
INSERT INTO `users` VALUES (3,'john.doe@company.com','$2b$12$9/zxQL5sZ7ZnNzu4O1Z84Rbl/GV2GX8F8..yK0ZHnP49spkMt4tYH','user','ak_4a7946b4a31d6f78','2023-01-28 10:12:00',NULL);
INSERT INTO `users` VALUES (4,'admin@example.org','$2b$12$CEyBIy6vT49TJJK2bkjATP8pu87rYlhKf5Iazmm.r82QRwEb02jbA','user','ak_14d8e842b4e51ec1','2023-04-21 10:14:00',NULL);
INSERT INTO `users` VALUES (5,'dev_ops@example.org','$2b$12$AcTGPbZ4.RSse93U8N.z5ANUIffDTrDmrJmLi1Ve2SLYibkmWmq5I','admin','ak_40d0b3de18f27a35','2023-07-09 10:15:00',NULL);

