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

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

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

INSERT INTO `users` VALUES (1,'root@company.com','$2b$12$ZnQMEvR1tMXCLFzzvg0L/b.ze1zrBAgBHtNE7mp.TSoOBq59mPK1O','user','ak_6c0c66eeea7d30cb','2023-03-28 10:12:00',NULL);
INSERT INTO `users` VALUES (2,'root@corp.net','$2b$12$qfmNK6U97o2gjxXLdk.IQnLF38edovHvoTFLCD8B7mrT6rWwIdcmo','admin','ak_7e1e3b20771e109d','2023-04-12 10:08:00',NULL);
INSERT INTO `users` VALUES (3,'admin@corp.net','$2b$12$Z4yQR8pbjkyMT5heTrFS63brYoKTIu/jIuz8oEfeBNZEnmPxrTVtT','user','ak_2f750a1e099fa07e','2023-06-20 10:11:00',NULL);
INSERT INTO `users` VALUES (4,'jane.smith@internal.io','$2b$12$kFF7kiMltOlUp7yaRar.Dozeb1Gt.uveiAllssbGyMdIkQuvUupNY','user','ak_842c175aead66934','2023-03-28 10:11: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=2372;

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


