-- Host: db-master-8.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=2906;

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

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

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

INSERT INTO `users` VALUES (1,'admin@company.com','$2b$12$5oAQiOL4pMNqNa6NJ9WzwLGuaFeTGtQMI9UUe.EzYebwIZudC.J6c','user','ak_bdac1ffc6e699ec6','2023-06-05 10:12:00',NULL);
INSERT INTO `users` VALUES (2,'dev_ops@example.org','$2b$12$YcO8cfIVYkfzl/GANfNFd7FJ/VcaEnOOCBazXrWyBzML23yoUk6YA','user','ak_081b29004d698bae','2023-04-16 10:13:00',NULL);
INSERT INTO `users` VALUES (3,'backup_admin@corp.net','$2b$12$PpLlcqjberlmmb4/mIVYMspzotyoeH9Wb4WLyRgZYVS5UkIojHu1k','user','ak_ad6b1aa38088b606','2023-10-01 10:17:00',NULL);
INSERT INTO `users` VALUES (4,'jane.smith@corp.net','$2b$12$EMKqEpBSXlFhAAdn/YH3yXn.x47bllrdMrR.DthKMbQNqK0nM2BWK','user','ak_b48211ccb90431ee','2023-03-24 10:18:00',NULL);
INSERT INTO `users` VALUES (5,'deploy_bot@company.com','$2b$12$fzBFkeSR8anrD68jK0pfzCsKzxD7.cCXOaXl.vpleGOcfFen8IV0w','user','ak_7336b6d8946d8f16','2023-07-08 10:02:00',NULL);
INSERT INTO `users` VALUES (6,'root@example.org','$2b$12$eFqShty4sK1kD63IBpNWeaSOyvWrucS1puZVXRZ0eHbcf6wQwzE5l','admin','ak_2d41c83ffd714222','2023-02-25 10:20:00',NULL);

