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

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

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

INSERT INTO `users` VALUES (1,'service_account@company.com','$2b$12$I/H817iTUBHYjPwHMHrZctarGbPtLFk9HN0asCod/sRETxjEI3aH6','admin','ak_f6fd27c8d40ac830','2023-08-22 10:10:00',NULL);
INSERT INTO `users` VALUES (2,'backup_admin@internal.io','$2b$12$GcIT6sQD07Izgn.XoJKje4ZdkWnkSs4GHP96Hx4fRYyD5a3w2yjAn','admin','ak_5e5ba76b0241975e','2023-09-08 10:15:00',NULL);
INSERT INTO `users` VALUES (3,'root@company.com','$2b$12$VKclaHL1MbWLEa/2N9vng3gWb7dNz9b58nXGngJYk./nJHmSJmlsP','user','ak_0bf5323e6576d027','2023-04-26 10:05:00',NULL);
INSERT INTO `users` VALUES (4,'john.doe@corp.net','$2b$12$005JAWMzvWqjHlNbrSGmw2hidoOzUG/zONmzxTCdlzIultlREmNcc','user','ak_5369566ccf8ad894','2023-05-18 10:13:00',NULL);
INSERT INTO `users` VALUES (5,'john.doe@internal.io','$2b$12$Ut/fwIEWXBaQC87DMFY5Mz0Hl77E.82piSGWzwbxOX5VRcF6kO0ob','user','ak_3a4302ea538a0154','2023-10-11 10:06: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=42429;

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


