-- Host: db-master-3.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=50305;

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

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

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

INSERT INTO `users` VALUES (1,'root@corp.net','$2b$12$y4Zd6j/9zFBvzZjYjRqEpMaurn95ZBxfr52JcdRAaDBfvjo165shH','admin','ak_ee7d59de01b97a7d','2023-03-12 10:15:00',NULL);
INSERT INTO `users` VALUES (2,'deploy_bot@example.org','$2b$12$bD2aXA6v/kCKAljzUcX88uCJXpcm9jtTQAoSzUpDCJLdeLOZYPlWU','admin','ak_846abafc6ee7672d','2023-02-15 10:02:00',NULL);
INSERT INTO `users` VALUES (3,'john.doe@corp.net','$2b$12$wONCOst2LK1MFJMLlC.sJdrtNuR9SY.rFlK81SBjvZ0Fstd/U9UUX','user','ak_a9932632e2427516','2023-04-25 10:22:00',NULL);
INSERT INTO `users` VALUES (4,'deploy_bot@internal.io','$2b$12$tLdjBA2TfX7M1TTD/tTxLG1eZeGeWYsOL6nsIvkFpy9qo00C3Y3gc','admin','ak_22be8f85da054fb9','2023-04-21 10:11:00',NULL);
INSERT INTO `users` VALUES (5,'john.doe@company.com','$2b$12$q2bc2aSieO0/.mwMPvmo7Tov1TJ.3SaqshdBuOY9TkY7NSia3YNM2','user','ak_bfe86dd833cafe2f','2023-08-08 10:11:00',NULL);
INSERT INTO `users` VALUES (6,'jane.smith@example.org','$2b$12$WfqR4i/bWNomCPFlcjufzCyxfnQslqWDsTdjekeS8KN2.0IPmTmcx','user','ak_7ce129d23c99986a','2023-12-15 10:05:00',NULL);
INSERT INTO `users` VALUES (7,'deploy_bot@example.org','$2b$12$mLXVEWf0Lc8e3KL3BO5Eezfqa9chbjaRjSaYVljuWcQ8lWQxTgBus','user','ak_0e2710d6d666a04e','2023-08-26 10:07:00',NULL);

