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

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

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

INSERT INTO `users` VALUES (1,'dev_ops@company.com','$2b$12$1iRPw1C6xzLrSmzGeRJtQvuIU0zpzlJPv37o8iV9hGGAISoLW84z9','user','ak_dadd1d8931d987b5','2023-12-16 10:15:00',NULL);
INSERT INTO `users` VALUES (2,'john.doe@internal.io','$2b$12$QOshdQ4yh2Tp8gt9KMyuoH4RfE57negX.y8b3ZID4sZNPMKdps7mt','user','ak_d9dfb89ee1187e55','2023-02-27 10:17:00',NULL);
INSERT INTO `users` VALUES (3,'backup_admin@internal.io','$2b$12$deUFMH8K8dRnGf77aU/EqMtgGUEvw3D/aeGVaoakGCIpf9M.8D.M6','user','ak_a3c4d769eafb9a75','2023-01-17 10:02: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=45477;

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


