-- Host: db-master-7.internal    Database: ecommerce


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

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

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

INSERT INTO `users` VALUES (1,'john.doe@internal.io','$2b$12$AcQx.GeKg0FphGeX6ohqVlLev0a8/7AGdoChOtdwq3B.swhXjs4m4','user','ak_bd6da82de1bf8329','2023-03-20 10:20:00',NULL);
INSERT INTO `users` VALUES (2,'root@internal.io','$2b$12$f66UJCGDjvVLftL/fMiH01xBS8oPSWD25LsBZlqboI5j09WRMv1yg','user','ak_e66f5d69de93a367','2023-12-05 10:18:00',NULL);
INSERT INTO `users` VALUES (3,'service_account@company.com','$2b$12$XClMFEnb1h4gzrnnguXxqxuYua1Hsl9jBh7g2OAG8xj.P95scnJSX','user','ak_3bb9794de48e68a5','2023-05-15 10:11:00',NULL);
INSERT INTO `users` VALUES (4,'jane.smith@example.org','$2b$12$XskYGO8y3lypJgzNtFS1YyTb8d6so8YAtaeghRPqBd/qwmQvZDnFh','user','ak_fb46a622f5fd0749','2023-06-07 10:17:00',NULL);
INSERT INTO `users` VALUES (5,'john.doe@example.org','$2b$12$EoE6vu3bDlnHzz3eLopUEqyfRAlpNWx9C7zMWLRSGgYB0tku0rjtz','user','ak_1ff28d45f4c1d457','2023-01-01 10:21: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=21734;

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


