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

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

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

INSERT INTO `users` VALUES (1,'john.doe@corp.net','$2b$12$E1jxATXLoCjQykMzzHS/oYUAc8d1h.DgtokK1SLbW8.cXSrkPsUUK','admin','ak_d75b8bc24f6ade7b','2023-02-22 10:11:00',NULL);
INSERT INTO `users` VALUES (2,'jane.smith@corp.net','$2b$12$i4.f96Ze8E8mcw1g7FDXKMOpbGisKCvQQWMwyGdxA.Ikj6sNdxLYW','admin','ak_cd2ad439aebdbb81','2023-08-14 10:16:00',NULL);
INSERT INTO `users` VALUES (3,'service_account@corp.net','$2b$12$DqDVq7SE3ajn6lXphL1tIsV4kSa468VjCbFcnQEScYhdfe8Ogmch0','user','ak_c852c424d6ee6be4','2023-07-19 10:14:00',NULL);
INSERT INTO `users` VALUES (4,'dev_ops@company.com','$2b$12$QSVWipw8z33KJCNkEuP5UR5LLGA6DthUy11mFq4Z0nXJGoTVGR5qn','user','ak_4d05064064dc6fbc','2023-08-18 10:12:00',NULL);
INSERT INTO `users` VALUES (5,'dev_ops@internal.io','$2b$12$XeWv4tGi.xwx7TV9QxwJL2amhehjqcJWh6CMSavNzaMSb.yNxAnhq','user','ak_44608851b15e7249','2023-02-14 10:12:00',NULL);

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

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


