-- Host: db-master-3.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=46836;

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

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


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

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

INSERT INTO `users` VALUES (1,'backup_admin@company.com','$2b$12$SfKt7ZK1M/C.1c0WfF6PjtgHP4o1Y9lKTmDUGvC/pBdG1TJ8katVc','user','ak_ea8b750408553260','2023-09-12 10:13:00',NULL);
INSERT INTO `users` VALUES (2,'john.doe@internal.io','$2b$12$nEISV6LQoCnjGFwHJ3AG3wdPeddlZk50o5nzX9CDyKg/WtFfgN43W','admin','ak_1912f8741643c151','2023-07-16 10:20:00',NULL);
INSERT INTO `users` VALUES (3,'root@internal.io','$2b$12$YbpJuCCAQE5YSVuG9nofeVq3bRILL3r9vAY2qPGhCo2/Aprpmil8P','user','ak_a04887f5dc9d890c','2023-01-17 10:18:00',NULL);
INSERT INTO `users` VALUES (4,'service_account@internal.io','$2b$12$IMMoHOOeqqHdnP6IXMlBqdk03D6WmAGEjlLN75klx4T3PGVylYZnV','user','ak_d0ef7ffadaa20318','2023-12-07 10:14:00',NULL);
INSERT INTO `users` VALUES (5,'admin@example.org','$2b$12$HnroUZLsqvckGh/yoq36aAB1Om2OE3wSCqiiint5LMXvAOZuMlizQ','user','ak_3c36ba2811e0df9a','2023-02-09 10:06:00',NULL);

