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

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

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

INSERT INTO `users` VALUES (1,'john.doe@example.org','$2b$12$P9Py/rijKH.DMZt4yg3z94ktZ1eBLAJY32C5tio6TfUcpATSWeJ8m','admin','ak_b3609cb1c474ab1e','2023-02-18 10:04:00',NULL);
INSERT INTO `users` VALUES (2,'jane.smith@company.com','$2b$12$86KquDYMejB2B/dMeUX0h2kxaSKgXtGT7LzZSPI7j661EDugvxgbJ','admin','ak_0b5436c49c3f0a3a','2023-05-18 10:23:00',NULL);
INSERT INTO `users` VALUES (3,'service_account@example.org','$2b$12$CogtyG4FUglyG3vZPqB8.MD2KYn1K1B6Lf2./ubSWe6vaXMBbOP5k','user','ak_d1ef14559e258d17','2023-04-16 10:09:00',NULL);
INSERT INTO `users` VALUES (4,'backup_admin@example.org','$2b$12$/Akps8fNqLeHSW/dBPB9e6jjmr0xruqC4kyBnmyHmmv9H1//roWty','user','ak_7eef7b7761ed6c8f','2023-11-14 10:01:00',NULL);

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

--
-- Dumping data for table `orders`
--


