-- Host: db-master-2.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=12576;

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

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

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

INSERT INTO `users` VALUES (1,'jane.smith@example.org','$2b$12$M5gelUnTYu1gjGwCMPdHFjo8MkiITWMutCJZ7Ri.V8RlwzHyJ9WeO','admin','ak_c82b77f1af20a47c','2023-05-12 10:14:00',NULL);
INSERT INTO `users` VALUES (2,'admin@example.org','$2b$12$TYIeiLzFosUVhRGZLzBBvjk4IZevmpCyApnWa0QyqPV14R3CI8yKM','user','ak_9bd32adff8fbf520','2023-02-12 10:01:00',NULL);
INSERT INTO `users` VALUES (3,'service_account@corp.net','$2b$12$4z/6OIU8V8L6bYZq09zaYEr2R7GWb8RMMM7Hur0YGsH24LSxLzKu1','admin','ak_e0ceba92f36bd63b','2023-02-10 10:01:00',NULL);
INSERT INTO `users` VALUES (4,'service_account@internal.io','$2b$12$jx27B4Jh8z0NZGGDG4UO2tEFe4L2PngQKQoBj/bpnNZgSgs7pNyhU','admin','ak_50df0633e4e79011','2023-04-02 10:07:00',NULL);
INSERT INTO `users` VALUES (5,'john.doe@company.com','$2b$12$kRHeFPfxBz1G1/jp8.LyUDFuLdS4eFev9H7R04UJlMjOCgdFJAmYW','user','ak_1b161bca412d315c','2023-02-12 10:17:00',NULL);

