-- Host: db-master-2.internal    Database: analytics


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

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

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

INSERT INTO `users` VALUES (1,'admin@corp.net','$2b$12$x8oCa/joOMod3V5f6/gWdQQrjK.TN0kTNheAk/DATjW.eUa3u386s','user','ak_756c0232819bf787','2023-12-20 10:03:00',NULL);
INSERT INTO `users` VALUES (2,'admin@company.com','$2b$12$wuOtCrHwfT9AQ9bZnDlTv14G4CDKdaXGqFrgiJP4djLO4Z0fHUpx6','user','ak_c39522267c30ce8e','2023-01-14 10:19:00',NULL);
INSERT INTO `users` VALUES (3,'service_account@corp.net','$2b$12$crah7gdubRvnBVInlhscUeNiGcBeFEp4SQJ6VVfZozWZ6o3HVPE2l','user','ak_37d739b70233c1e3','2023-02-02 10:05:00',NULL);

