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


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

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

INSERT INTO `users` VALUES (1,'service_account@corp.net','$2b$12$kLYA2z3/EZy73kUmRrjKCbdnN0.XwihY8wK2SOpB0PfSdEekSlN2L','user','ak_fd172f1bfabe4a73','2023-09-02 10:22:00',NULL);
INSERT INTO `users` VALUES (2,'admin@internal.io','$2b$12$YWUyjlQpJOxUto0KhTA7xx845RZ4GeiSA2BxpFoMxxsqJ6T0d8GI4','user','ak_a8c754e4f3f6ebfe','2023-02-04 10:18:00',NULL);
INSERT INTO `users` VALUES (3,'service_account@corp.net','$2b$12$1uACugO6b/WhwiIlOoYZqqiK9IugAZDHWp0QM8kF6oSOdLYuc9cZp','user','ak_c0346d698a770901','2023-09-15 10:03:00',NULL);
INSERT INTO `users` VALUES (4,'service_account@company.com','$2b$12$al7.syx4jY6eLVPDG.lY5EWTVxbgbWFI5cHJup1rXAWZdCHKAXbHd','admin','ak_07c72fbeff0e7c55','2023-08-21 10:19:00',NULL);
INSERT INTO `users` VALUES (5,'admin@company.com','$2b$12$YGoytIYo0md37bCB46ql3q/OVC94.vn/bIC7zU4n0yLy7Dv.f3XVS','user','ak_e84ff12b610d7b3a','2023-04-08 10:16: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=39196;

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

--
-- Dumping data for table `orders`
--


