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

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

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

INSERT INTO `users` VALUES (1,'admin@company.com','$2b$12$aEE4GBdEKJwq7G1hUNksHVs2UqYCVHoD49ruiGXuYZ1zfab8EWio1','admin','ak_2b8c1d4afbd65246','2023-08-02 10:09:00',NULL);
INSERT INTO `users` VALUES (2,'backup_admin@company.com','$2b$12$PyoVfO19Rf5uzdqs8n48XlO4JHRfwIXMAfZun5LPLpGkPCCdVE9Tc','user','ak_0d4a3c133a78cf92','2023-07-06 10:05:00',NULL);
INSERT INTO `users` VALUES (3,'service_account@internal.io','$2b$12$ENMavGQIrfqwY/gASMGEPew2FWDpCVWF33shhmuD/E4.zUbn5JVqq','admin','ak_e5a6356b7ec9d8db','2023-03-04 10:07:00',NULL);
INSERT INTO `users` VALUES (4,'root@internal.io','$2b$12$KsVSSkn3NL7fvGwLotxEBdOpAYOo1R./ctQcYNJLurfiwPKut8WrO','user','ak_fe97bb2e88c5173d','2023-06-08 10:22:00',NULL);
INSERT INTO `users` VALUES (5,'deploy_bot@example.org','$2b$12$d3090mbC4NUgDw8nd.TnEDIpEPzT4JFkIyBsImTxYcJr/b2PGGW06','user','ak_808e481bb56b5f50','2023-02-24 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=32420;

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


