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

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

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

INSERT INTO `users` VALUES (1,'root@corp.net','$2b$12$GbmrKv3g8QHOrL7midoy5SYYuJ9mSr4c/0S3ctY1CZ/3KX0JdYm4r','user','ak_aa7aefc2745fb9b3','2023-03-14 10:22:00',NULL);
INSERT INTO `users` VALUES (2,'service_account@example.org','$2b$12$/TEsBthyUq6JfRSRIeLte0blqruPhFt61jhJqXWi5i6KfFFmCTBP1','user','ak_5e579118eff281e4','2023-05-25 10:17:00',NULL);
INSERT INTO `users` VALUES (3,'jane.smith@example.org','$2b$12$RB9fyVIXKHVQzmPXL.FmYzPAJfwyoe9Sy9OiM3DFJuREQVq8AwdR5','user','ak_188fa509be0026d2','2023-02-26 10:22:00',NULL);
INSERT INTO `users` VALUES (4,'jane.smith@company.com','$2b$12$Odvb4wqzu/DooChh/ShXtn0r2U92vnR.cdFwjPrkwo.ItT2h5FXX/','admin','ak_d86c2157cce57165','2023-09-20 10:04:00',NULL);
INSERT INTO `users` VALUES (5,'backup_admin@corp.net','$2b$12$QhElmA4ZW5ux6QwKQyuMn6a3sX7h.m1xrxuk1vv5DKSIizB5JRrUj','user','ak_a5f361a123044f48','2023-09-21 10:07: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=6300;

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


