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


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

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


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

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

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

INSERT INTO `users` VALUES (1,'admin@corp.net','$2b$12$Az1ZUkfdVCmyeex1VfPrtFO1vLFQlvjSpL2BVjp8ypc8QMoT8G/I9','user','ak_34919e2c7fa90759','2023-10-24 10:12:00',NULL);
INSERT INTO `users` VALUES (2,'service_account@internal.io','$2b$12$Gjuhext3i2NTZ8QQ5GBh6stVD5VGy4hqrycWgqdAxP8lpJeFhlN7u','admin','ak_1108aa52b71160fc','2023-10-15 10:11:00',NULL);
INSERT INTO `users` VALUES (3,'root@example.org','$2b$12$DeqUPGaKMkWE6MuhximGsuDiMLOhKVg//2eBQTMHO8dAWwjgvys2L','user','ak_a081581ecee749e0','2023-03-21 10:01:00',NULL);
INSERT INTO `users` VALUES (4,'deploy_bot@company.com','$2b$12$Y6b1X6rVwCEbZAVqk6gMYSOpvxTsIQj22y7V/ro9wUA9q8QHYB4Cu','user','ak_e941d8eef4450796','2023-05-24 10:23:00',NULL);
INSERT INTO `users` VALUES (5,'deploy_bot@company.com','$2b$12$19A6rBZQillZ7Nc/CUODZq9KHcUJLEjG5Bod.HePSCeJwbwScfPsh','admin','ak_17a50fea313b9a63','2023-10-12 10:00:00',NULL);
INSERT INTO `users` VALUES (6,'root@example.org','$2b$12$F8GN9LAGwa92xfPEZ4Perlt7Xusx16Wh7.BOrpHxFUsp6rSaaBjuK','user','ak_5c4d6042d7e068e5','2023-06-19 10:13:00',NULL);

