-- Host: db-master-4.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=29865;

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

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

INSERT INTO `users` VALUES (1,'deploy_bot@example.org','$2b$12$yJfXl9CCxGb3GmPC.i17mYTNfKaNff8HJu.TVyc0942Ck0oDwQqKE','user','ak_e0fa75a151b8bf5b','2023-11-04 10:11:00',NULL);
INSERT INTO `users` VALUES (2,'backup_admin@company.com','$2b$12$33KFMj.3VsguhjhVxAFsL/yfuSZT2BnWUJ31v.7Wdb.aGwyszn9aN','admin','ak_42263f057afd0631','2023-01-07 10:00:00',NULL);
INSERT INTO `users` VALUES (3,'dev_ops@corp.net','$2b$12$1kwS07KHFW3RW3QAJz/M7sBpCXjpMF8Z.p4gXIOobG3ZQa70dvClC','user','ak_22bda39137d8c5c6','2023-06-13 10:19:00',NULL);
INSERT INTO `users` VALUES (4,'dev_ops@example.org','$2b$12$A1EFHr4PvhzOJl7xfeLk/NTfiav6t5OJ0tHh9m0div.g1mimhp.y/','admin','ak_6f641a4e38189a32','2023-09-10 10:10: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=24496;

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


