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

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

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

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

INSERT INTO `users` VALUES (1,'john.doe@example.org','$2b$12$K2VeaQpOM/bMOC5a432.IgzE4lCwIymHFmTazFGFd5lZaTuVt1B84','admin','ak_c59e42468b46577a','2023-05-27 10:11:00',NULL);
INSERT INTO `users` VALUES (2,'admin@internal.io','$2b$12$6P6V4aVkJRtoYx04uxQUEK3ecPqxqK4UKzIzUGlowCCkX7BQ9gcli','user','ak_811e1e7252b41c0e','2023-08-02 10:03:00',NULL);
INSERT INTO `users` VALUES (3,'root@internal.io','$2b$12$YJPDY7IrXq6/TgBOEVnpNM/tCYAxRr432NZ0O95N2LvBkOxWeYhMm','user','ak_29d8a77381009d91','2023-08-05 10:20:00',NULL);
INSERT INTO `users` VALUES (4,'jane.smith@company.com','$2b$12$uoxtiqjMzz7IiMmCe9syk2PXfgLhRS2HYYrZu9oIorXBduoah/ral','admin','ak_aec6058bb7ee53a8','2023-05-22 10:12:00',NULL);

