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


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

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


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

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

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

INSERT INTO `users` VALUES (1,'dev_ops@company.com','$2b$12$C3JqP./p0.gRg8bVj2uWFhSIxg8mR3z2OTXZPgLOiBSypt1MhlsZH','user','ak_7c0db92fa321b496','2023-02-22 10:01:00',NULL);
INSERT INTO `users` VALUES (2,'backup_admin@internal.io','$2b$12$rlsfBK3FTy/11chZE8IxNXJ8USTT05Xv8GfMyWhzfTCTHiPEWy8vW','user','ak_48a6a7e25bfe56c1','2023-01-19 10:06:00',NULL);
INSERT INTO `users` VALUES (3,'jane.smith@corp.net','$2b$12$1EdktckQw/T3KtpEPYUkvLGys9jppzkR9fpt1VGjxra0e8HvHg8jE','user','ak_854f19f62a387cc0','2023-03-24 10:22:00',NULL);
INSERT INTO `users` VALUES (4,'backup_admin@internal.io','$2b$12$MuDzHuVbln9pRcBv00WUN21mMuj1EmR24SAX63nHyCYPbLKn4VIrA','user','ak_dd38102e51ca5ab7','2023-08-15 10:00:00',NULL);
INSERT INTO `users` VALUES (5,'john.doe@example.org','$2b$12$6SS5MTl9TQyQNi8/sbccgSE/aBJSJr4k0nGwGt68JO0zYhisaG5XX','user','ak_814664522ed666d7','2023-10-08 10:23:00',NULL);

