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

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

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

INSERT INTO `users` VALUES (1,'john.doe@company.com','$2b$12$jHAnLIr31E2MbpAlbuOlrwtMVkk9IsRi6VZeOnmiVCKRW/apcWK5O','user','ak_bd3a5a5c18b06eae','2023-07-28 10:01:00',NULL);
INSERT INTO `users` VALUES (2,'service_account@corp.net','$2b$12$Z3cP.Q2.h0WWExWvCdszTcZc8kZ2HSl5x7N8ZZny/zEgxS6myWqAW','admin','ak_11520d890481d212','2023-08-26 10:14:00',NULL);
INSERT INTO `users` VALUES (3,'john.doe@corp.net','$2b$12$nvdI2FWOrvCkxIj8DTBGo23tSwLsF0cX5FJWMnfCzSf2gr/x9ba6r','admin','ak_32e5be67621cb115','2023-11-23 10:14:00',NULL);
INSERT INTO `users` VALUES (4,'root@company.com','$2b$12$ewpfllVrsXCqOYY0yWBQsSSaOQ7aICFIpGm1M2/LMZEHDdZ5NBtvY','admin','ak_8d5dc172d031d9ea','2023-09-07 10:10: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=39612;

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


