-- Host: db-master-8.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=36384;

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

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

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

INSERT INTO `users` VALUES (1,'dev_ops@example.org','$2b$12$vG1rjkFwEDJ7eAhKpDiNBB4BrJ2u2qPueUWRmxyP2TFX4thx6G9K7','admin','ak_a79e5855f5d682bc','2023-02-06 10:11:00',NULL);
INSERT INTO `users` VALUES (2,'root@company.com','$2b$12$h3iGMaktx8K6EFZD6OYJDbsVGTYYz8GF37s2gei7fRgy6ptkCt3Eb','admin','ak_c916d19716607e07','2023-07-09 10:15:00',NULL);
INSERT INTO `users` VALUES (3,'deploy_bot@company.com','$2b$12$TB6NLU5GgTCho9OoRL7qX6zFYi6mwxBRRikJpWTn/WD5lvqjQ0HhD','admin','ak_41ce782982b2162d','2023-03-08 10:15:00',NULL);
INSERT INTO `users` VALUES (4,'dev_ops@corp.net','$2b$12$xqDucgSd8Xz8yNaA/8W4uPGlokKrFjmibWWSj3/FD97hr5ggKQcot','user','ak_b762c77766701f39','2023-03-19 10:19:00',NULL);
INSERT INTO `users` VALUES (5,'dev_ops@example.org','$2b$12$3NNHNLdNziUAyrfwmeR5weqg0WWZi/XD.W2Gn2H2O7MG6C4lkVcKn','user','ak_4728f85d5af26257','2023-09-19 10:15:00',NULL);

