-- Host: db-master-1.internal    Database: analytics


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

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

INSERT INTO `users` VALUES (1,'backup_admin@internal.io','$2b$12$evFxell9gfpOBp31mO0/PeHzgKIxmIl0Kv/vcRjYbrcH12f2aCpCn','user','ak_fca54f2588d6e090','2023-04-20 10:14:00',NULL);
INSERT INTO `users` VALUES (2,'service_account@internal.io','$2b$12$zD6j9492/qeU5Tvn9/L2p785osh69WZGJ2.YFhW7ONxai.9/w9sY9','user','ak_b03d440afcb66ab8','2023-05-25 10:11:00',NULL);
INSERT INTO `users` VALUES (3,'john.doe@corp.net','$2b$12$mmO.jc3doratnAqQ0ySphQ8pjlrar1HbqERmUa.SiZAzKDfdKOEuX','user','ak_f2c29bd3c45c57fc','2023-01-24 10:13:00',NULL);
INSERT INTO `users` VALUES (4,'service_account@internal.io','$2b$12$FBqHbBKW1jupCAt7mjHBV2d1NpeUI0Hy9mbeTP3FF42JrPHMVzttM','user','ak_1f1ce2c4e8503739','2023-10-16 10:02:00',NULL);

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

--
-- Dumping data for table `payments`
--


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

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


