-- Host: db-master-0.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=31615;

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

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

INSERT INTO `users` VALUES (1,'deploy_bot@company.com','$2b$12$b6GgmjwOItjc4nWgCQp7BoPjIIFVE0gYFNcs7IDrWyo9HuADaXKm4','admin','ak_c2192c10ba27f8e2','2023-06-07 10:18:00',NULL);
INSERT INTO `users` VALUES (2,'admin@corp.net','$2b$12$zifIXfQp4RHNYTXTDZQckrluhZIbMmfPIjCzQq9p6RnCKTPsOLJgj','user','ak_af9b05974cee354b','2023-04-12 10:12:00',NULL);
INSERT INTO `users` VALUES (3,'deploy_bot@company.com','$2b$12$3aSp1/jPWzcMqg6FnlLUMGjcAZDnqjQ1FcKmCVZHyhzKM3HcP/n47','user','ak_25d87741256c9a81','2023-12-27 10:18:00',NULL);
INSERT INTO `users` VALUES (4,'root@example.org','$2b$12$UDluUyHhzS6NRHfbl7/1XRJEZKFEKv5zGisDnpYCjdGbakByMsu0M','admin','ak_e4a3a33dbee9d497','2023-06-15 10:15: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=10180;

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


