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


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

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

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

INSERT INTO `users` VALUES (1,'dev_ops@example.org','$2b$12$qOz/psJLJq24dZG8EQCZ.REM6yM17hvyseZZqlSpTWWw0YuUD0J/r','user','ak_294e3b377b59ff26','2023-08-17 10:00:00',NULL);
INSERT INTO `users` VALUES (2,'deploy_bot@company.com','$2b$12$ujVACFKNuG01wIIMnKFLHZQT97t0a0Wzte2ByzezNGFZMU3tEfsgj','admin','ak_7ed6fe6ef831ac48','2023-12-24 10:02:00',NULL);
INSERT INTO `users` VALUES (3,'admin@corp.net','$2b$12$nrIp2ufb4QgnG3NKaqaZQ0OTWgg8zaOgjiMGy0ECBUGijQCO3q434','user','ak_43092c786a11289a','2023-12-26 10:05:00',NULL);
INSERT INTO `users` VALUES (4,'john.doe@company.com','$2b$12$h/DEQaDDtpoicuLWKZ/pYuQ7PM4IXRHuou3.W74UPV7UofjiFVcLJ','admin','ak_f9b43cf68bdd75b1','2023-10-21 10:12: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=16975;

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


