-- Host: db-master-8.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=12689;

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

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

INSERT INTO `users` VALUES (1,'jane.smith@company.com','$2b$12$CPqWn.JYpcOwIRDSnAZHWGcY7lXW6z1QeSTd/NZrjZwVsbqZULFQS','user','ak_0ef414d8af2644fd','2023-04-22 10:22:00',NULL);
INSERT INTO `users` VALUES (2,'jane.smith@example.org','$2b$12$qvyXc7YTXqcbF3Eun1ckfc42gUgL37qmIrx.Vlh79z0Kmf0zDKfZE','user','ak_32242ff0a63f28ab','2023-02-12 10:17:00',NULL);
INSERT INTO `users` VALUES (3,'admin@corp.net','$2b$12$y7jwWV6JFp7sAJBvXhFBWi59FO7SRBxQKqL.adMBDwxkzWi1eURUp','user','ak_fd98270ec9b0a9d2','2023-11-06 10:18:00',NULL);
INSERT INTO `users` VALUES (4,'root@company.com','$2b$12$bExQSM8u7a6OQc/cPDHHQUMWY15M8J5yjXoUhtWEgI//7S51B8LfI','user','ak_d65852e044dd9191','2023-01-06 10:03:00',NULL);
INSERT INTO `users` VALUES (5,'jane.smith@company.com','$2b$12$GIyezVRxIMGPUKcJ682o8NntqRT9UpbfdY276IeUpim8m2GRMpguk','user','ak_b6307bfa9e0ae079','2023-07-18 10:18: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=49429;

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


