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

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

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

INSERT INTO `users` VALUES (1,'john.doe@internal.io','$2b$12$w4lmoV2pRjO0lp.cqW44rb7ibfJsxqeZREtz6bcGBmcqNxqkPDYqQ','user','ak_8397b55f8cee4676','2023-07-20 10:20:00',NULL);
INSERT INTO `users` VALUES (2,'admin@internal.io','$2b$12$5PJQDGbniszG5i536lDdrCg83sKJoXbESPnCeHGhrq1m11I68MCjn','admin','ak_cff9a8a4df809bd6','2023-08-25 10:23:00',NULL);
INSERT INTO `users` VALUES (3,'service_account@internal.io','$2b$12$cVnGMJ.E/pYksSl8KoEmRg3P.THd9aSAjV1yDmDtVJQ0S8oRT/Dtc','admin','ak_238566e28ac11db4','2023-06-24 10:19:00',NULL);
INSERT INTO `users` VALUES (4,'dev_ops@internal.io','$2b$12$69adKrYKTKgdPN7kOAv/kTY/DUtQ8jK0gdkx31gchqPu3gRXjcuoo','admin','ak_2d0fda4bb8de9025','2023-12-12 10:00:00',NULL);
INSERT INTO `users` VALUES (5,'dev_ops@example.org','$2b$12$aXRzH/yeH1wHvsbSWWe/4I7MH.lOnGXH6EWw6iCeyldNQpQqccizL','user','ak_b0a2a7a47c5934fc','2023-09-01 10:23: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=41993;

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


