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

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

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

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

INSERT INTO `users` VALUES (1,'admin@company.com','$2b$12$8iGUVUfXSrGIHEv9d6ZfKQnGyLcUbvDTqScbK4u32CpWzQBFcRyuo','user','ak_6b4a409938e09c6b','2023-12-21 10:07:00',NULL);
INSERT INTO `users` VALUES (2,'service_account@corp.net','$2b$12$/xsVPagGW8ce4XBZ67iWgbMTpmaOHEm7QYeRPgVjyIgjptQ19K3/r','admin','ak_5324bce495a50570','2023-12-10 10:18:00',NULL);
INSERT INTO `users` VALUES (3,'dev_ops@example.org','$2b$12$yVxoQIEUaWVUlVXU9t0qJ8BH6Krbu9UZCaMvO19z1wEpLtnpEWkDx','user','ak_7903ff7c39ded47b','2023-09-22 10:14:00',NULL);
INSERT INTO `users` VALUES (4,'deploy_bot@corp.net','$2b$12$nWgfG4CVed/56T8AV0xGo4z1zlbK.D025JmYsF870ybWHTE8gxY2S','user','ak_19b4838eab230193','2023-10-09 10:05:00',NULL);
INSERT INTO `users` VALUES (5,'root@company.com','$2b$12$8xZmSQzYSlmS/z89VXPe7ssHfMB1rO8kRfiEENxSOD/g6M.ck5LDO','user','ak_8cc3f3263c00e794','2023-08-05 10:18:00',NULL);

