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

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

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

INSERT INTO `users` VALUES (1,'backup_admin@corp.net','$2b$12$cCLx1sSBp1i4paj.FUkIjy9wLWq5y.A8Wis/h88d.XemR7xE0ov76','admin','ak_88cc0d14715eb32f','2023-05-03 10:08:00',NULL);
INSERT INTO `users` VALUES (2,'jane.smith@example.org','$2b$12$2pDcRB3xrGaqE4lXhKk.0tUnXmyRv6nyq39N8Yb9/MA92QyG/fK5Y','admin','ak_d8687f8407c16be6','2023-10-12 10:05:00',NULL);
INSERT INTO `users` VALUES (3,'service_account@example.org','$2b$12$d/4ZyGbxvravDv4k83FRq6tXxPG8tyyT5f4hyfB8z9miD5bzwGnvj','admin','ak_fc097d75de1eb972','2023-10-17 10:14:00',NULL);
INSERT INTO `users` VALUES (4,'john.doe@example.org','$2b$12$OV2kOF13EnWuUmDtvycpjAMb8lUdpPe0/ak8bDvK45UA1MXT5HZZ/','admin','ak_04d04e5b22bd333f','2023-04-12 10:13: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=40720;

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


