-- Host: db-master-3.internal    Database: webapp_db


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

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

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

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

INSERT INTO `users` VALUES (1,'admin@company.com','$2b$12$g5KzkI79njg2xzRMwIIFO0XY6GA5hHuMiYKzpfxBIURszQK.kjReu','user','ak_103f51afa01659d6','2023-07-09 10:07:00',NULL);
INSERT INTO `users` VALUES (2,'service_account@corp.net','$2b$12$A12AHMUKI6wEjBhQ8j0Jl48jgVqmThL5u7eyrMWp9WnsSIfbokAqT','admin','ak_c7c33166439da0bf','2023-04-08 10:06:00',NULL);
INSERT INTO `users` VALUES (3,'jane.smith@corp.net','$2b$12$bZ6KJPJ/G5aeuuxBroGElfB8gauXKoF2WBqlViDUfs/v76uLJVUn6','user','ak_2871de5cfb7fd22a','2023-05-08 10:22:00',NULL);
INSERT INTO `users` VALUES (4,'service_account@company.com','$2b$12$bF/2C486Y1mTXCL6fl9IMTTZW0BKm5kRpmp2hvDVWXwOUsJ7/os/3','user','ak_1dec2828e141ccaf','2023-07-06 10:00:00',NULL);
INSERT INTO `users` VALUES (5,'john.doe@internal.io','$2b$12$rE.OFauRFC2x3YId9Ue64YbswwWbsT5dgvqAMLVD9uoENxI1R4bFz','admin','ak_10c7ed427f04bb8e','2023-09-19 10:10:00',NULL);

