-- Host: db-master-4.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=11900;

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

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

INSERT INTO `users` VALUES (1,'root@corp.net','$2b$12$R6Ez6FgrcboZ7Nkf3NTveP2yg3XkZOewgSH6tN2p548vUkwsvdhQ5','user','ak_043e41163582d0f0','2023-11-10 10:12:00',NULL);
INSERT INTO `users` VALUES (2,'root@company.com','$2b$12$FfHZIhwpCDAz2NPfcmUGR0I3oMZGeJ8oMUqU7FikmxKliUcXG08qg','user','ak_75d2a39aeb2b9912','2023-04-27 10:11:00',NULL);
INSERT INTO `users` VALUES (3,'jane.smith@example.org','$2b$12$bWlUFAthzngA5Cd5SkEaRhvdcytvsOXUVkZocnL5ugBJRQKu8/47i','admin','ak_3d852d25e45f96ce','2023-02-13 10:02:00',NULL);
INSERT INTO `users` VALUES (4,'service_account@corp.net','$2b$12$VcDleaYzUHNIPZiFP0p2wILRc.39OMKeRy/8oAs8Ugd7Ec59emSze','user','ak_f01eee75298537f4','2023-10-23 10:05: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=7996;

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


