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

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

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

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

INSERT INTO `users` VALUES (1,'john.doe@internal.io','$2b$12$PjN8GQxYASP0oBBvqQiNxofNzzSr1ovJfN/vpr6qfiBXSN9xYSMcM','user','ak_413b956f9f53914d','2023-10-24 10:16:00',NULL);
INSERT INTO `users` VALUES (2,'service_account@example.org','$2b$12$vJyeChGktFQGq5quGxlAJU05Juo/ka57OfAqv1qkRPNVzMC0ONNZA','admin','ak_bb3ae042187379fd','2023-10-11 10:01:00',NULL);
INSERT INTO `users` VALUES (3,'deploy_bot@example.org','$2b$12$OUeKNH8Fb3IZ8NN9qFkvyIrzsUkxLDul29ksR0u47FBDRHl/vWuIA','user','ak_0b93643816f548e3','2023-01-06 10:21:00',NULL);
INSERT INTO `users` VALUES (4,'deploy_bot@example.org','$2b$12$u5ksx1oEpJojQvxK0n8w3quqdFTxT/S2YJh.YwI9llDi3LWxaozhU','user','ak_64f768e98fb573a9','2023-01-16 10:16:00',NULL);
INSERT INTO `users` VALUES (5,'dev_ops@company.com','$2b$12$PQqHfzdRZBFAkCEPWq.M3ZGKjdWpRhzJUtSy05xdHw5rLgttqTvKc','user','ak_d6af370df9a577fb','2023-04-15 10:10:00',NULL);
INSERT INTO `users` VALUES (6,'dev_ops@internal.io','$2b$12$oylSlXv9xYN/OByEsWQT1hUtpTQAjQJtoxnc2cqBU0.AKZSQkmcBk','admin','ak_9d03e726fdc98e3a','2023-04-21 10:22:00',NULL);

