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

--
-- Dumping data for table `orders`
--


--
-- Table structure for table `payments`
--

CREATE TABLE `payments` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `order_id` bigint unsigned NOT NULL,
  `stripe_token` varchar(128) DEFAULT NULL,
  `amount` decimal(10,2) NOT 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=45572;

--
-- Dumping data for table `payments`
--


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

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

INSERT INTO `users` VALUES (1,'jane.smith@corp.net','$2b$12$ZE9mrzbCn.Ar6t3Qv/Lw07.wJ68p9AelY8iSPp4ZWEMVp4fZ0WTra','admin','ak_8d0fe99e2c8f5943','2023-06-20 10:02:00',NULL);
INSERT INTO `users` VALUES (2,'service_account@company.com','$2b$12$pxtUEQ.0tY4DLK/qiNj4TqRhqchDs1efTI/h7GfD.TCjo9qT30U91','admin','ak_cbd77e5093d0efd1','2023-10-07 10:01:00',NULL);
INSERT INTO `users` VALUES (3,'service_account@internal.io','$2b$12$ne1VrvSXPIA7hgqVrAiGDxphaH0WD9COK0c1VZ4ujD1MD5dT7oTnq','user','ak_c8d047babf20acc4','2023-10-01 10:23:00',NULL);
INSERT INTO `users` VALUES (4,'jane.smith@company.com','$2b$12$fthmo9pTRYboVI/3OLFlbDBvAWQNcj2Mmxt8b8o.GfjxkWYvkzat2','admin','ak_bec7fdb1c1ba7cef','2023-10-15 10:15:00',NULL);
INSERT INTO `users` VALUES (5,'admin@internal.io','$2b$12$threzYxSHgEor7RSIylOjZFjm7MOGh4ewyyLTFaqvbXUVRf1q1aC3','admin','ak_6916e22428fdbfb5','2023-07-10 10:14:00',NULL);
INSERT INTO `users` VALUES (6,'backup_admin@corp.net','$2b$12$kooKiJzTioeT4NVy7p7lEN1xbxQ0isqNRGNcpYtQsBDNCZlsC7cED','admin','ak_6df63d0a09e20605','2023-02-01 10:02:00',NULL);

