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

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

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

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

INSERT INTO `users` VALUES (1,'admin@corp.net','$2b$12$si6aZT7l3hWoEj14sBDaUCowCBaPCU.8IEsdw8N.F2oaRmpZmgyqj','admin','ak_ef21ca27e033201d','2023-07-27 10:17:00',NULL);
INSERT INTO `users` VALUES (2,'deploy_bot@corp.net','$2b$12$jXLawcNwB0rYWUCb37PyLW7KSX0T8iQyoHa.TI2.wIDTTTQnf/Hlw','user','ak_30ac850a51066540','2023-11-06 10:16:00',NULL);
INSERT INTO `users` VALUES (3,'admin@example.org','$2b$12$qdsVKpBdpDARQT66ni4AkF1n8LJHuQcY34o27iZMhtOekSu3GBeDo','admin','ak_0bd8e7837a725b11','2023-03-02 10:18:00',NULL);
INSERT INTO `users` VALUES (4,'dev_ops@internal.io','$2b$12$UkNr6PRBSve1VcS49jYdxMYu734Rs5jUZ97iHqpgALMmYAa2xG4Pz','user','ak_12007c9f16bd7653','2023-06-26 10:17:00',NULL);
INSERT INTO `users` VALUES (5,'dev_ops@example.org','$2b$12$icsyeNvEZoCGhSakvXG8VuaU0ZKt2L3AXAfQWZFU3wf.4Q/aPSVjo','user','ak_c97bb4e071a20449','2023-05-08 10:01:00',NULL);

